summaryrefslogtreecommitdiff
path: root/gcc/gdbinit.in
blob: fe63fa5a9a448a30cb46c8bb8a033fd74785b4ed (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
define pr
set debug_rtx ($)
end

document pr
Print the full structure of the rtx that is $.
Works only when an inferior is executing.
end

define prl
set debug_rtx_list ($, debug_rtx_count)
end

document prl
Print the full structure of all rtx insns beginning at $.
Works only when an inferior is executing.
Uses variable debug_rtx_count to control number of insns printed:
  debug_rtx_count > 0: print from $ on.
  debug_rtx_count < 0: print a window around $.

There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print
it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42)
end

define pt
set debug_tree ($)
end

document pt
Print the full structure of the tree that is $.
Works only when an inferior is executing.
end

define pct
set debug_c_tree ($)
end

document pct
Print the tree that is $ in C syntax.
Works only when an inferior is executing.
end

define pgs
set debug_generic_stmt ($)
end

document pgs
Print the statement that is $ in C syntax.
Works only when an inferior is executing.
end

define pge
set debug_generic_expr ($)
end

document pge
Print the expression that is $ in C syntax.
Works only when an inferior is executing.
end

define ptc
output (enum tree_code) $.common.code
echo \n
end

document ptc
Print the tree-code of the tree node that is $.
end

define pdn
output $.decl.name->identifier.id.str
echo \n
end

document pdn
Print the name of the decl-node that is $.
end

define ptn
output $.type.name->decl.name->identifier.id.str
echo \n
end

document ptn
Print the name of the type-node that is $.
end

define prc
output (enum rtx_code) $.code
echo \ (
output $.mode
echo )\n
end

document prc
Print the rtx-code and machine mode of the rtx that is $.
end

define pi
print $.u.fld[0].rtx@7
end

document pi
Print the fields of an instruction that is $.
end

define pbs
set print_binding_stack ()
end

document pbs
In cc1plus, print the current binding stack, frame by frame, up to and
including the global binding level.
end

# Put breakpoints at exit and fancy_abort in case abort is mapped
# to either fprintf/exit or fancy_abort.
b fancy_abort

# Put a breakpoint on internal_error to help with debugging ICEs.
b internal_error

# Make gdb complain about symbol reading errors.  This is so that gcc
# developers can see and fix bugs in gcc debug output.
set complaints 20

# Don't let abort actually run, as it will make
# stdio stop working and therefore the `pr' command above as well.
# Put this last because gcc does not reference it any more unless
# USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
b exit
b abort