https://llvm.org/bugs/show_bug.cgi?id=24928

            Bug ID: 24928
           Summary: Evaluating expression returning an std::shared_ptr<T>
                    fails
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Compile the following code with the following command on Linux x86_64: "clang++
-g -std=c++11 main.cpp", then set a breakpoint on the marked line and evaluate
the expression "foo(sp)" while stopped at the breakpoint.

Expected behavior is to display the result of the expression, but lldb returns
with the following error message:
call to a function 'std::__shared_ptr<int,
__gnu_cxx::_Lock_policy>::~__shared_ptr()'
('_ZNSt12__shared_ptrIiN9__gnu_cxx12_Lock_policyEED2Ev') that is not present in
the target

Tested on Linux x86_64 with clang-3.5 and gcc-4.8.4

#include <memory>

std::shared_ptr<int> foo(const std::shared_ptr<int>& sp) {
    return sp;
}

int main() {
    std::shared_ptr<int> sp = std::make_shared<int>(42);
    auto sp2 = foo(sp);
    return 0; // Break here and run "expression foo(sp)"
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to