Skip to content

Commit b49c1d1

Browse files
committed
feat: preattach/waitfor attach functionality
1 parent 5da105e commit b49c1d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Extension/src/Debugger/attachWaitFor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export class AttachWaitFor {
2424

2525
//Naive poll mechanism, parses /proc for a while till a match is found
2626
private async poll(program: string): Promise<string | undefined> {
27+
this._channel.clear()
2728
const startTime = Date.now(); // Get the current time in milliseconds
2829
let seen = new Set<string>();
2930
let process: string | undefined;
30-
3131
while (true) {
3232
const elapsedTime = Date.now() - startTime;
3333

@@ -62,6 +62,9 @@ export class AttachWaitFor {
6262
if (!process && p.detail!.includes(program)) {
6363
console.log("Found program waiting for with pid %s - info %s", p.id!, p.detail!)
6464
process = p.id!
65+
66+
// Send sigstop by default?
67+
util.execChildProcess(`kill -STOP ${process}`, undefined, this._channel)
6568
return
6669
}
6770

0 commit comments

Comments
 (0)