I am trying to debug a C ++ OS X application in Xcode 5.1 (5B130a) under OS X 10.9.2. The application consists of various library projects that are compiled into libraries and are used in the main application project.
I set a breakpoint in my code and when I started lldb:
expr 2
here is what i get:
(lldb) expr 2 error: field '__f_' declared with incompatible types in different translation units ('__base *' (aka 'std::__1::__function::__base<void (std::__1::shared_ptr<const XXX>, const YYY &)> *') vs. '__base *' (aka 'std::__1::__function::__base<void> *')) error: field '__f_' declared with incompatible types in different translation units ('__base *' (aka 'std::__1::__function::__base<void (std::__1::shared_ptr<const XXX>, const YYY &)> *') vs. '__base *' (aka 'std::__1::__function::__base<void> *')) error: expected expression note: declared here with type '__base *' (aka 'std::__1::__function::__base<void> *') note: declared here with type '__base *' (aka 'std::__1::__function::__base<void> *') error: 3 errors parsing expression
Note that if I set a breakpoint elsewhere in the code, this same command may work (but not everywhere). This makes me think that the particular library that I am breaking matters.
I understand that somewhere there is a definition for std::function<void(std::shared_ptr<const XXX>, const YYY&)> and that some other translation unit sees it with a different definition (I assume that __f_ is the internal field of the template is std :: function templated), however this is not clear to me:
- Why doesn't the replicator complain about this? (in fact, the application works fine)
- what code generation switch mismatch can this cause? I already checked
GCC_OPTIMIZATION_LEVEL (all -O0 ), COPY_PHASE_STRIP , ...
Thanks!
source share