Skip to content

Commit c543052

Browse files
committed
Remove tailing " (deleted)" from executable name returned by readlink
Summary: When calling readlink, " (deleted)" is appended to executable path if it's deleted. Remove if it's there. Reviewers: chaoren, sivachandra, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9583 llvm-svn: 236802
1 parent 81fa35c commit c543052

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/test/tools/lldb-server/gdbremote_testcase.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ def init_llgs_test(self, use_named_pipe=True):
159159
err = platform.Run(shell_command)
160160
if err.Fail():
161161
raise Exception("remote_platform.RunShellCommand('readlink /proc/%d/exe') failed: %s" % (pid, err))
162-
self.debug_monitor_exe = shell_command.GetOutput().strip()
162+
// If the binary has been deleted, the link name has " (deleted)" appended.
163+
// Remove if it's there.
164+
self.debug_monitor_exe = re.sub(r' \(deleted\)$', '', shell_command.GetOutput().strip())
163165
dname = self.dbg.GetSelectedPlatform().GetWorkingDirectory()
164166
else:
165167
self.debug_monitor_exe = get_lldb_server_exe()

0 commit comments

Comments
 (0)