blob: 845bf696efa0eb1d1bc4f78394f7b68a2e704dde (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#pragma once
#include <sys/user.h>
#include <unistd.h>
#include "list.h"
struct breakpoint {
LINKEDLIST;
unsigned long address;
unsigned long text;
int installed;
int hits;
unsigned long stack;
pid_t tid;
int enabled;
};
struct map {
LINKEDLIST;
unsigned long start;
unsigned long end;
void *data;
};
struct state {
LINKEDLIST;
struct user_regs_struct regs;
struct user_fpregs_struct fpregs;
struct list maps;
};
struct process {
LINKEDLIST;
pid_t id;
int child;
struct list threads;
struct list breakpoints;
};
struct thread {
LINKEDLIST;
struct process *proc;
struct list states;
struct state *state;
int clearstates;
pid_t id;
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 struct process *dbg_attach(pid_t pid, int child);
extern int dbg_detach(struct process *proc);
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 void *deref(struct thread *th, unsigned long address, size_t size);
|