115 |
cd src |
cd src |
116 |
gdb emacs |
gdb emacs |
117 |
b xmenu.c:1296 |
b xmenu.c:1296 |
118 |
r -q |
r -q |
119 |
|
|
120 |
Then type C-x 5 2 to create a new frame, and it hits the breakpoint: |
Then type C-x 5 2 to create a new frame, and it hits the breakpoint: |
121 |
|
|
128 |
$2 = (struct frame *) 0x3f0800 |
$2 = (struct frame *) 0x3f0800 |
129 |
(gdb) p *$ |
(gdb) p *$ |
130 |
$3 = { |
$3 = { |
131 |
size = 536871989, |
size = 536871989, |
132 |
next = 0x366240, |
next = 0x366240, |
133 |
name = 809661752, |
name = 809661752, |
134 |
[...] |
[...] |
135 |
} |
} |
136 |
(gdb) p $3->name |
(gdb) p $3->name |
177 |
XVECTOR (recent_keys)->contents[recent_keys_index] = c; |
XVECTOR (recent_keys)->contents[recent_keys_index] = c; |
178 |
|
|
179 |
So we define a GDB command `xvector-elts', so the last 10 keystrokes |
So we define a GDB command `xvector-elts', so the last 10 keystrokes |
180 |
are printed by |
are printed by |
181 |
|
|
182 |
xvector-elts recent_keys recent_keys_index 10 |
xvector-elts recent_keys recent_keys_index 10 |
183 |
|
|
189 |
xvector |
xvector |
190 |
set $foo = $ |
set $foo = $ |
191 |
while $i < $arg2 |
while $i < $arg2 |
192 |
p $foo->contents[$arg1-($i++)] |
p $foo->contents[$arg1-($i++)] |
193 |
pr |
pr |
194 |
end |
end |
195 |
document xvector-elts |
document xvector-elts |
217 |
|
|
218 |
By printing the remaining elements of args, you can see the argument |
By printing the remaining elements of args, you can see the argument |
219 |
values. Here's how to print the first argument: |
values. Here's how to print the first argument: |
220 |
|
|
221 |
p args[1] |
p args[1] |
222 |
pr |
pr |
223 |
|
|
230 |
|
|
231 |
and, assuming that "xtype" says that args[0] is a symbol: |
and, assuming that "xtype" says that args[0] is a symbol: |
232 |
|
|
233 |
xsymbol |
xsymbol |
234 |
|
|
235 |
** Debugging what happens while preloading and dumping Emacs |
** Debugging what happens while preloading and dumping Emacs |
236 |
|
|
450 |
helpful to set the `DEBUGSOURCES' and `DEBUG_FILE' environment |
helpful to set the `DEBUGSOURCES' and `DEBUG_FILE' environment |
451 |
variables, so that one can see what LessTif was doing at this point. |
variables, so that one can see what LessTif was doing at this point. |
452 |
For instance |
For instance |
453 |
|
|
454 |
export DEBUGSOURCES="RowColumn.c:MenuShell.c:MenuUtil.c" |
export DEBUGSOURCES="RowColumn.c:MenuShell.c:MenuUtil.c" |
455 |
export DEBUG_FILE=/usr/tmp/LESSTIF_TRACE |
export DEBUG_FILE=/usr/tmp/LESSTIF_TRACE |
456 |
emacs & |
emacs & |