[Lldb-commits] [lldb] [lldb] Fix TestGdbRemoteForkNonStop.py test (PR #131293)

via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 14 00:53:17 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Georgiy Samoylov (sga-sc)

<details>
<summary>Changes</summary>

During lldb testing on remote targets TestGdbRemoteForkNonStop.py freezes because in this test we try to create file on remote machine using absolute file path from local machine. This patch fixes this error

---
Full diff: https://github.com/llvm/llvm-project/pull/131293.diff


1 Files Affected:

- (modified) lldb/test/API/tools/lldb-server/main.cpp (+4-2) 


``````````diff
diff --git a/lldb/test/API/tools/lldb-server/main.cpp b/lldb/test/API/tools/lldb-server/main.cpp
index c661f5b4e82c4..fc3776832d6b6 100644
--- a/lldb/test/API/tools/lldb-server/main.cpp
+++ b/lldb/test/API/tools/lldb-server/main.cpp
@@ -344,8 +344,10 @@ int main(int argc, char **argv) {
     } else if (consume_front(arg, "process:sync:")) {
       // this is only valid after fork
       const char *filenames[] = {"parent", "child"};
-      std::string my_file = arg + "." + filenames[is_child];
-      std::string other_file = arg + "." + filenames[!is_child];
+      size_t pos = arg.find_last_of("/\\");
+      std::string file_name = arg.substr(pos + 1);
+      std::string my_file = file_name + "." + filenames[is_child];
+      std::string other_file = file_name + "." + filenames[!is_child];
 
       // indicate that we're ready
       FILE *f = fopen(my_file.c_str(), "w");

``````````

</details>


https://github.com/llvm/llvm-project/pull/131293


More information about the lldb-commits mailing list