diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 626d26ab6a07a30589e7fdad293595232c0f969e..736a54a092d809b1ec855d93785b90b7aa8f801a 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -788,7 +788,11 @@ std::string PlatformRemoteGDBServer::MakeUrl(const char *scheme, const char *hostname, uint16_t port, const char *path) { StreamString result; - result.Printf("%s://[%s]", scheme, hostname); + // OHOS_LOCAL begin + bool is_abstract = !strcmp(scheme, "unix-abstract-connect"); + auto* fmt_str = is_abstract ? "%s://%s" : "%s://[%s]"; + result.Printf(fmt_str, scheme, hostname); + // OHOS_LOCAL end if (port != 0) result.Printf(":%u", port); if (path) diff --git a/lldb/test/API/linux/domain-socket/Makefile b/lldb/test/API/linux/domain-socket/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c9319d6e6888a4aba8365c8953fa2206e546c950 --- /dev/null +++ b/lldb/test/API/linux/domain-socket/Makefile @@ -0,0 +1,2 @@ +C_SOURCES := main.c +include Makefile.rules diff --git a/lldb/test/API/linux/domain-socket/TestDomainSocketConnect.py b/lldb/test/API/linux/domain-socket/TestDomainSocketConnect.py new file mode 100644 index 0000000000000000000000000000000000000000..1fcdb21a2dfbfa8e2e99328053805aade358cc49 --- /dev/null +++ b/lldb/test/API/linux/domain-socket/TestDomainSocketConnect.py @@ -0,0 +1,26 @@ +''' +Test PC native debug can be connected in domain-socket mode. +''' + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestDomainSocketConnect(TestBase): + + @skipUnlessPlatform("remote-linux") + def test_with_run_command(self): + """Test that auto types work in the expression parser""" + self.build() + lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c")) + + self.expect_expr('auto f = 123456; f', result_type='int', result_value='123456') + self.expect( + 'expr struct Test { int x; int y; Test() : x(123), y(456) {} }; auto t = Test(); t', + substrs=[ + 'Test', + '123', + '456']) + self.expect_expr("auto s = foo; s", result_type="long", result_value="1234") diff --git a/lldb/test/API/linux/domain-socket/main.c b/lldb/test/API/linux/domain-socket/main.c new file mode 100644 index 0000000000000000000000000000000000000000..3ead9e4957a632fa7f0252ee0119bfcb855a00e8 --- /dev/null +++ b/lldb/test/API/linux/domain-socket/main.c @@ -0,0 +1,6 @@ +int main() +{ + long foo = 1234; + + return 0; // break here +}