Skip to content

Commit 18cba4b

Browse files
fix Linux process tree to include the full executable path
1 parent b2c0382 commit 18cba4b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lldb/tools/lldb-dap/src-ts/process-tree/platforms/linux-process-tree.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ export class LinuxProcessTree extends BaseProcessTree {
66
}
77

88
protected override getCommandArguments(): string[] {
9-
return ["-axo", "pid=PID,lstart=START,comm:128=COMMAND,command=ARGUMENTS"];
9+
return [
10+
"-axo",
11+
// The length of exe must be large enough or data will be truncated.
12+
`pid=PID,lstart=START,exe:128=COMMAND,args=ARGUMENTS`,
13+
];
1014
}
1115

1216
protected override createParser(): ProcessTreeParser {
@@ -24,9 +28,14 @@ export class LinuxProcessTree extends BaseProcessTree {
2428
return;
2529
}
2630

31+
const command = line.slice(commandOffset, argumentsOffset).trim();
32+
if (command === "-") {
33+
return;
34+
}
35+
2736
return {
2837
id: Number(pid[1]),
29-
command: line.slice(commandOffset, argumentsOffset).trim(),
38+
command,
3039
arguments: line.slice(argumentsOffset).trim(),
3140
start: Date.parse(line.slice(pid[0].length, commandOffset).trim()),
3241
};

0 commit comments

Comments
 (0)