summaryrefslogtreecommitdiffstats
path: root/debugger.h
diff options
context:
space:
mode:
Diffstat (limited to 'debugger.h')
-rw-r--r--debugger.h86
1 files changed, 72 insertions, 14 deletions
diff --git a/debugger.h b/debugger.h
index 6305e96..cf2c442 100644
--- a/debugger.h
+++ b/debugger.h
@@ -8,13 +8,19 @@
#define BREAKPOINT_INSN 0xcc
+extern PANEL *consolepan;
+
struct breakpoint {
LINKEDLIST;
+ unsigned long orig;
unsigned long address;
unsigned long stack;
- unsigned long orig;
+ pid_t tid;
int enabled;
int active;
+ /* add count field
+ * and stop boolean
+ * to implement checkpoints? */
};
struct map {
@@ -31,25 +37,77 @@ struct state {
struct list maps;
};
-struct tracee {
- struct list breaks;
+struct process {
+ pid_t id;
+ int child;
+ struct list breakpoints;
+ struct list threads;
+};
+
+struct thread {
+ LINKEDLIST;
+ struct process *proc;
+
struct list states;
struct state *state;
+ int clearstates;
+
pid_t id;
- int child;
int stopped;
- int status;
int signal;
int cont;
- void *buff;
- size_t buffsize;
+ const char *status;
};
-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);
-extern int dbg_stepin(struct tracee *dbg);
-extern int dbg_stepover(struct tracee *dbg);
+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 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_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 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);