[Lldb-commits] [lldb] r291103 - Fix jModulesInfo handling for cross-path syntax debugging

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 5 05:18:47 PST 2017


Author: labath
Date: Thu Jan  5 07:18:46 2017
New Revision: 291103

URL: http://llvm.org/viewvc/llvm-project?rev=291103&view=rev
Log:
Fix jModulesInfo handling for cross-path syntax debugging

We were sending paths with the host path separator, which meant the remote
target did not understand our packets correctly.

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=291103&r1=291102&r2=291103&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Jan  5 07:18:46 2017
@@ -3246,7 +3246,7 @@ GDBRemoteCommunicationClient::GetModules
     JSONObject::SP module_sp = std::make_shared<JSONObject>();
     module_array_sp->AppendObject(module_sp);
     module_sp->SetObject(
-        "file", std::make_shared<JSONString>(module_file_spec.GetPath()));
+        "file", std::make_shared<JSONString>(module_file_spec.GetPath(false)));
     module_sp->SetObject("triple",
                          std::make_shared<JSONString>(triple.getTriple()));
   }

Modified: lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp?rev=291103&r1=291102&r2=291103&view=diff
==============================================================================
--- lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp (original)
+++ lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp Thu Jan  5 07:18:46 2017
@@ -199,14 +199,22 @@ TEST_F(GDBRemoteCommunicationClientTest,
 
   FileSpec file_specs[] = {
       FileSpec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix),
-      FileSpec("/foo/baz.so", false, FileSpec::ePathSyntaxPosix)};
+      FileSpec("/foo/baz.so", false, FileSpec::ePathSyntaxPosix),
+
+      // This is a bit dodgy but we currently depend on GetModulesInfo not
+      // performing denormalization. It can go away once the users
+      // (DynamicLoaderPOSIXDYLD, at least) correctly set the path syntax for
+      // the FileSpecs they create.
+      FileSpec("/foo/baw.so", false, FileSpec::ePathSyntaxWindows),
+  };
   std::future<llvm::Optional<std::vector<ModuleSpec>>> async_result =
       std::async(std::launch::async,
                  [&] { return client.GetModulesInfo(file_specs, triple); });
   HandlePacket(
       server, "jModulesInfo:["
               R"({"file":"/foo/bar.so","triple":"i386-pc-linux"},)"
-              R"({"file":"/foo/baz.so","triple":"i386-pc-linux"}])",
+              R"({"file":"/foo/baz.so","triple":"i386-pc-linux"},)"
+              R"({"file":"/foo/baw.so","triple":"i386-pc-linux"}])",
       R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)"
       R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}]])");
 




More information about the lldb-commits mailing list