EugeneBi added a comment.

In https://reviews.llvm.org/D49685#1178125, @labath wrote:

> In https://reviews.llvm.org/D49685#1177046, @EugeneBi wrote:
>
> > It is specific to shared libraries. Opening the executable and core dump 
> > follows different code path.
>
>
> Which path is that? Is the path different even when you don't specify an 
> executable when opening the core file (`target create --core /my/file.core`). 
> I believe that in this case we should end up here 
> https://github.com/llvm-mirror/lldb/blob/7c07b8a9314eef118f95b57b49fa099be0808eac/source/Plugins/Process/elf-core/ProcessElfCore.cpp#L255,
>  which should eventually call `Platform::GetSharedModule`. Is that not the 
> case?


I did not try not to specify executable - what's the point in doing that? LLDB 
would fail to find symbols.

Here is the stack I captured when I debugged the problem. I believe that 
DynamicLoaderPOSIXDYLD::LoadAllCurrentModules did not try to load the 
executable.

(gdb) bt
#0  lldb_private::ModuleList::GetSharedModule (module_spec=..., 
module_sp=std::shared_ptr (empty) 0x0,

  module_search_paths_ptr=0x83ad60, old_module_sp_ptr=0x7fffffffbb50, 
did_create_ptr=0x7fffffffbb07,
  always_create=false) at 
/home/eugene/llvm/tools/lldb/source/Core/ModuleList.cpp:710

#1  0x00007fffedc2d130 in lldb_private::Platform::<lambda(const 
lldb_private::ModuleSpec&)>::operator()(const lldb_private::ModuleSpec &) const 
(__closure=0x8581b0, spec=...)

  at /home/eugene/llvm/tools/lldb/source/Target/Platform.cpp:234

#2  0x00007fffedc34ff2 in std::_Function_handler<lldb_private::Status(const 
lldb_private::ModuleSpec&), lldb_private::Platform::GetSharedModule(const 
lldb_private::ModuleSpec&, lldb_private::Process*, lldb::ModuleSP&, const 
lldb_private::FileSpecList*, lldb::ModuleSP*, bool*)::<lambda(const 
lldb_private::ModuleSpec&)> >::_M_invoke(const std::_Any_data &, const 
lldb_private::ModuleSpec &) (__functor=..., __args#0=...) at 
/usr/include/c++/5/functional:1857
#3  0x00007fffedc37978 in std::function<lldb_private::Status 
(lldb_private::ModuleSpec const&)>::operator()(lldb_private::ModuleSpec const&) 
const (this=0x7fffffffba80, __args#0=...) at /usr/include/c++/5/functional:2267
#4  0x00007fffedc3375a in 
lldb_private::Platform::GetRemoteSharedModule(lldb_private::ModuleSpec const&, 
lldb_private::Process*, std::shared_ptr<lldb_private::Module>&, 
std::function<lldb_private::Status (lldb_private::ModuleSpec const&)> const&, 
bool*) (this=0x839330, module_spec=..., process=0x84d310, 
module_sp=std::shared_ptr (empty) 0x0,

  module_resolver=..., did_create_ptr=0x7fffffffbb07)
  at /home/eugene/llvm/tools/lldb/source/Target/Platform.cpp:1628

#5  0x00007fffedc2d2cd in lldb_private::Platform::GetSharedModule 
(this=0x839330, module_spec=...,

  process=0x84d310, module_sp=std::shared_ptr (empty) 0x0, 
module_search_paths_ptr=0x83ad60,
  old_module_sp_ptr=0x7fffffffbb50, did_create_ptr=0x7fffffffbb07)
  at /home/eugene/llvm/tools/lldb/source/Target/Platform.cpp:240

#6  0x00007fffedc9957c in lldb_private::Target::GetSharedModule (this=0x846960, 
module_spec=..., error_ptr=0x0)

  at /home/eugene/llvm/tools/lldb/source/Target/Target.cpp:1952

#7  0x00007fffef8e0d11 in lldb_private::DynamicLoader::LoadModuleAtAddress 
(this=0x9a0a70, file=...,

  link_map_addr=139700267943784, base_addr=139700263510016, 
base_addr_is_offset=true)
  at /home/eugene/llvm/tools/lldb/source/Core/DynamicLoader.cpp:171

#8  0x00007fffedd8fb55 in DynamicLoaderPOSIXDYLD::LoadAllCurrentModules 
(this=0x9a0a70)

  at 
/home/eugene/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:537

#9  0x00007fffedd8de52 in DynamicLoaderPOSIXDYLD::DidAttach (this=0x9a0a70)

  at 
/home/eugene/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:171

#10 0x00007fffedc476d9 in lldb_private::Process::LoadCore (this=0x84d310)

  at /home/eugene/llvm/tools/lldb/source/Target/Process.cpp:2853


https://reviews.llvm.org/D49685



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to