fjricci created this revision.
fjricci added reviewers: ovyalov, ADodds, jasonmolenda, clayborg.
fjricci added subscribers: sas, lldb-commits.

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.

http://reviews.llvm.org/D19557

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4863,14 +4863,7 @@
         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);
 


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4863,14 +4863,7 @@
         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);
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to