summaryrefslogtreecommitdiffstats
path: root/debugger.h
diff options
context:
space:
mode:
Diffstat (limited to 'debugger.h')
-rw-r--r--debugger.h75
1 files changed, 18 insertions, 57 deletions
diff --git a/debugger.h b/debugger.h
index cf2c442..845bf69 100644
--- a/debugger.h
+++ b/debugger.h
@@ -3,24 +3,19 @@
#include <sys/user.h>
#include <unistd.h>
-#include "console.h"
#include "list.h"
-#define BREAKPOINT_INSN 0xcc
-
-extern PANEL *consolepan;
-
struct breakpoint {
LINKEDLIST;
- unsigned long orig;
+
unsigned long address;
+ unsigned long text;
+ int installed;
+ int hits;
+
unsigned long stack;
pid_t tid;
int enabled;
- int active;
- /* add count field
- * and stop boolean
- * to implement checkpoints? */
};
struct map {
@@ -38,10 +33,11 @@ struct state {
};
struct process {
+ LINKEDLIST;
pid_t id;
int child;
- struct list breakpoints;
struct list threads;
+ struct list breakpoints;
};
struct thread {
@@ -56,58 +52,23 @@ struct thread {
int stopped;
int signal;
int cont;
+
const char *status;
};
+//extern struct list global_processes;
+//extern struct thread *global_thread;
+
extern void add_breakpoint(struct process *proc, unsigned long address, unsigned long stack, pid_t tid, int enabled);
extern int is_breakpoint(struct process *proc, unsigned long address);
-extern int dbg_process(struct process *proc, pid_t pid, int child);
+extern struct process *dbg_attach(pid_t pid, int child);
extern int dbg_detach(struct process *proc);
-extern int dbg_wait(struct thread *th, int dostops);
-extern int dbg_cont(struct thread *th, int cont);
-extern int dbg_stepin(struct thread *th);
-extern int dbg_intr(struct thread *th);
-extern void *deref(struct thread *th, unsigned long addr, size_t size);
-
-
-
-
-
-
-
-
-
-/* how to do an async 'all-cont':
- *
- * mark all threads for PTRACE_CONT
- * singlestep all threads
- * this is needed to step past any thread that may be starting at a breakpoint
- * wait all single steps (note that some may hang...)
- * once all single steps completed, install breakpoints and actually cont threads
- */
-
-//extern void add_breakpoint(struct process *proc, unsigned long address, unsigned long stack, pid_t tid, int enabled);
-//extern int is_breakpoint(struct process *proc, unsigned long address);
-//
-//extern int dbg_process(struct process *proc, pid_t pid);
-//extern int dbg_wait(struct thread *th, int dostops);
-//extern int dbg_stepin(struct thread *th);
-//extern int dbg_stepover(struct thread *th);
-//extern int dbg_cont(struct thread *th, int cont);
-//extern int dbg_intr(struct thread *th);
-//extern int dbg_detach(struct process *proc);
-//extern void *deref(struct thread *th, unsigned long addr, size_t size);
-
-
+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_step(struct thread *th, int stepover);
+extern int dbg_pets(struct thread *th);
-//extern int dbg_process(struct tracee *dbg, pid_t pid);
-//extern int dbg_new_process(struct tracee *dbg, char **argv, struct console *cons);
-//extern int dbg_wait(struct tracee *dbg, PANEL *pan);
-//extern int dbg_stepin(struct tracee *dbg);
-//extern int dbg_stepover(struct tracee *dbg);
-//extern int dbg_stepout(struct tracee *dbg);
-//extern int dbg_cont(struct tracee *dbg, int mode);
-//extern void *deref(struct tracee *dbg, unsigned long addr, size_t size);
-//extern void dbg_free(struct tracee *dbg);
+extern void *deref(struct thread *th, unsigned long address, size_t size);