1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:27:35 +00:00

ptrace: Stop a traced thread when it exists from execve

This was a missing feature in the PT_TRACEME command.

This feature allows the tracer to interact with the tracee before the
tracee has started executing its program.

It will be useful for automatically inserting a breakpoint at a
debugged program's entry point.
This commit is contained in:
Itamar 2020-04-06 16:08:25 +03:00 committed by Andreas Kling
parent 4568a628f9
commit 0431712660
3 changed files with 58 additions and 16 deletions

View file

@ -1,8 +1,12 @@
#include <cstdio>
int main(int, char**)
{
printf("before breakpoint\n");
asm("int3");
printf("after breakpoint\n");
printf("Debuggee main\n");
int s = 0;
for (int i = 0; i < 10; ++i) {
s++;
}
printf("s: %d\n", s);
// asm("int3");
return 0;
}