[Lldb-commits] [lldb] [lldb] Fix TestGdbRemoteForkNonStop.py test (PR #131293)
Georgiy Samoylov via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 14 00:52:43 PDT 2025
https://github.com/sga-sc created https://github.com/llvm/llvm-project/pull/131293
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
>From 8c8e7145b7b2a38a08a2a4197a6624fc82c4265f Mon Sep 17 00:00:00 2001
From: Georgiy Samoylov <g.samoylov at syntacore.com>
Date: Fri, 7 Mar 2025 14:05:36 +0300
Subject: [PATCH] [lldb] Added file opening by name
---
lldb/test/API/tools/lldb-server/main.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
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");
More information about the lldb-commits
mailing list