Skip to content

Commit

Permalink
Use absolute module path when possible if sent in svr4 packets
Browse files Browse the repository at this point in the history
Summary:
If the remote uses svr4 packets to communicate library info,
the LoadUnload tests will fail, as lldb only used the basename
for modules, causing problems when two modules have the same basename.

Using absolute path as sent by the remote will ensure that lldb
locates the module from the correct directory when there are overlapping
basenames. When debugging a remote process, LoadModuleAtAddress will still
fall back to using basename and module_search_paths, so we don't
need to worry about using absolute paths in this case.

Reviewers: ADodds, jasonmolenda, clayborg, ovyalov

Subscribers: lldb-commits, sas

Differential Revision: http://reviews.llvm.org/D19557

This is a cherry-pick of r267741

llvm-svn: 270140
  • Loading branch information
fjricci committed May 19, 2016
1 parent 7da818f commit ffd93c1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Expand Up @@ -4835,14 +4835,7 @@ ProcessGDBRemote::LoadModules (LoadedModuleInfoList &module_list)
if (!modInfo.get_link_map (link_map))
link_map = LLDB_INVALID_ADDRESS;

// hack (cleaner way to get file name only?) (win/unix compat?)
size_t marker = mod_name.rfind ('/');
if (marker == std::string::npos)
marker = 0;
else
marker += 1;

FileSpec file (mod_name.c_str()+marker, true);
FileSpec file (mod_name.c_str(), true);
lldb::ModuleSP module_sp = LoadModuleAtAddress (file, link_map, mod_base,
mod_base_is_offset);

Expand Down

0 comments on commit ffd93c1

Please sign in to comment.