diff options
author | Malfurious <m@lfurio.us> | 2023-09-28 15:05:51 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-04-24 13:31:08 -0400 |
commit | 41945242524f9ecc795138fdb5beb31362f7826a (patch) | |
tree | 2ebc530fce27be7918606ac47d0c32c669502226 | |
parent | 5e20ea14800abaa62b15fcf2bb8462e5661ffdc7 (diff) | |
download | misplays-41945242524f9ecc795138fdb5beb31362f7826a.tar.gz misplays-41945242524f9ecc795138fdb5beb31362f7826a.zip |
dbg_realcont for testing purposes
Signed-off-by: Malfurious <m@lfurio.us>
-rw-r--r-- | debugger.c | 19 | ||||
-rw-r--r-- | debugger.h | 1 | ||||
-rw-r--r-- | misplays.c | 3 |
3 files changed, 23 insertions, 0 deletions
@@ -499,6 +499,25 @@ int dbg_cont(struct thread *th, int cont) { return 0; } +int dbg_realcont(struct thread *th) { + if (th->id < 0 || !th->stopped) { + return -1; + } + + struct list *threads = &th->proc->threads; + for (struct thread *t = threads->head; t != threads->end; t = t->next) { + ptrace(PTRACE_CONT, t->id, NULL, NULL); + + t->stopped = 0; + t->signal = 0; + t->cont = 0; + t->status = "RUNNING"; + t->clearstates = 1; + } + + return 0; +} + int dbg_step(struct thread *th, int stepover) { // todo: support step-out //if (th->id < 0 || !th->stopped) { @@ -68,6 +68,7 @@ extern int dbg_wait(struct thread *th, int recursion); extern int dbg_intr(struct thread *th); extern int dbg_cont(struct thread *th, int cont); +extern int dbg_realcont(struct thread *th); extern int dbg_step(struct thread *th, int stepover); extern int dbg_pets(struct thread *th); @@ -265,6 +265,9 @@ int main(int argc, char **argv) { case 'c': dbg_cont(th, PTRACE_CONT); break; + case 'C': + dbg_realcont(th); + break; case 'p': dbg_intr(th); break; |