-
Notifications
You must be signed in to change notification settings - Fork 5
/
wdb-objs.h
102 lines (85 loc) · 1.94 KB
/
wdb-objs.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef WDB_OBJS_H
#define WDB_OBJS_H
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include "gimli_dwarf.h"
#ifdef __cplusplus
extern "C" {
#endif
#define WDB_MAX_FRAMES 256
/* represents a thread */
struct wdb_thread {
int tid;
int nframes;
struct gimli_thread_state *st;
struct gimli_unwind_cursor frames[WDB_MAX_FRAMES];
void *pcaddrs[WDB_MAX_FRAMES];
void *contexts[WDB_MAX_FRAMES];
};
#define WDB_THREAD "wdb.thread"
/* iterator/accessor for threads */
struct wdb_threads {
int nthr;
};
#define WDB_THREADS "wdb.threads"
/* represents a frame */
struct wdb_frame {
int thread_ref;
struct wdb_thread *thr;
int nframe;
struct gimli_unwind_cursor frame;
};
#define WDB_FRAME "wdb.frame"
/* iterator/accessor for frames */
struct wdb_frames {
int thread_ref;
struct wdb_thread *thr;
int nframe;
};
#define WDB_FRAMES "wdb.frames"
/* iterator/access for variables in a frame */
struct wdb_vars {
struct gimli_unwind_cursor cur;
struct gimli_dwarf_die *die;
struct gimli_dwarf_die *iter;
uint64_t frame_base;
uint64_t comp_unit_base;
struct gimli_object_mapping *m;
};
#define WDB_VARS "wdb.vars"
/* represents a variable in the target */
struct wdb_var {
struct gimli_unwind_cursor cur;
struct gimli_dwarf_die *die;
uint64_t frame_base;
uint64_t comp_unit_base;
struct gimli_object_mapping *m;
int is_stack;
struct gimli_dwarf_attr *type;
struct gimli_dwarf_attr *name;
uint64_t location;
struct gimli_dwarf_die *iter, *td;
/* for bitfields */
int mask, shift;
};
#define WDB_VAR "wdb.var"
#if 0
/* represents the value of a variable in the target.
* This is basically a thin layer over an wdb_var. */
struct wdb_value {
struct wdb_var var;
struct gimli_dwarf_die *iter, *td;
struct gimli_dwarf_attr *type;
/* for bitfields */
int mask, shift;
};
#define WDB_VALUE "wdb.value"
#endif
void wdb_register(lua_State *L);
#ifdef __cplusplus
}
#endif
#endif
/* vim:ts=2:sw=2:et:
*/