diff options
| author | Pavel Labath <labath@google.com> | 2017-01-05 13:18:46 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-01-05 13:18:46 +0000 |
| commit | 763f1c453b59970c76c93f919b1514ab5c533c70 (patch) | |
| tree | 356f7dd5d2a906f645e0b1e4602af7d1d22c68a7 | |
| parent | f31c9d27a47314afdba50996d8a705fb8e9e6dad (diff) | |
| download | bcm5719-llvm-763f1c453b59970c76c93f919b1514ab5c533c70.tar.gz bcm5719-llvm-763f1c453b59970c76c93f919b1514ab5c533c70.zip | |
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.
llvm-svn: 291103
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 2 | ||||
| -rw-r--r-- | lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index f9bbaef6021..55551b267e8 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -3246,7 +3246,7 @@ GDBRemoteCommunicationClient::GetModulesInfo( 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())); } diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp index 84b354d7517..4bac9ebd404 100644 --- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp +++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp @@ -199,14 +199,22 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) { 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}]])"); |

