Skip to content

Commit 8c8e714

Browse files
committed
[lldb] Added file opening by name
1 parent ac94ccd commit 8c8e714

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/test/API/tools/lldb-server/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,10 @@ int main(int argc, char **argv) {
344344
} else if (consume_front(arg, "process:sync:")) {
345345
// this is only valid after fork
346346
const char *filenames[] = {"parent", "child"};
347-
std::string my_file = arg + "." + filenames[is_child];
348-
std::string other_file = arg + "." + filenames[!is_child];
347+
size_t pos = arg.find_last_of("/\\");
348+
std::string file_name = arg.substr(pos + 1);
349+
std::string my_file = file_name + "." + filenames[is_child];
350+
std::string other_file = file_name + "." + filenames[!is_child];
349351

350352
// indicate that we're ready
351353
FILE *f = fopen(my_file.c_str(), "w");

0 commit comments

Comments
 (0)