-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
81 lines (74 loc) · 1.7 KB
/
README
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
This project relies on being able to consume debugging information (DWARF)
about C executables to automatically generate C pretty printers. It utilizes
dwarfdump, to get at the symbols, some perl to process that into some C and
dlopen to link in at runtime.
Resources:
parse_syms - an automatic pretty print generator which reads dwarf debug
symbols out of objects with dwarfdump
dwarfpp - a linkable library that can be called to pretty print arbitrary
types
----------------------------------------------------
./test
# Example output for the given test.c
# uint64_t l = 1;
# l <<= 45;
# foo_t f = { 0, "lol", 0, { 0 }, &foo, 0, 0, 1231, 1211111, -21, 200, -66 };
# foo_t h = { 1100, "baz", &f, { 0 }, &foo, 1.1, 2121323112.2132, 13212, 13212332, 55, 0, 120 };
# foo_t g = { 1000, "bar", &h, { 0 }, NULL, 110000.2312, 122.11, 2312, l, 321, 11, 0 };
#
# f.bar = 10;
# f.foo_next = &g;
#
# char * foo = dwarfpp(&g, "foo_t");
struct foo {
bar : 1000,
baz : "bar",
foo_next : struct foo {
bar : 1100,
baz : "baz",
foo_next : struct foo {
bar : 10,
baz : "lol",
foo_next : ROOT,
stuff : [
0,
0,
0
],
fun : (int (*)(char *)) &foo,
f : 0.000000,
d : 0,
ui32 : 1231,
ui64 : 1211111,
s : -21,
uc : 200,
c : -66
},
stuff : [
0,
0,
0
],
fun : ROOT->foo_next->foo_next->fun,
f : 1.100000,
d : 2.12132e+09,
ui32 : 13212,
ui64 : 13212332,
s : 55,
uc : 0,
c : 120
},
stuff : [
0,
0,
0
],
fun : NULL,
f : 110000.234375,
d : 122.11,
ui32 : 2312,
ui64 : 35184372088832,
s : 321,
uc : 11,
c : 0
}