Fri Jun 24 15:04:14 CEST 2011

gdb and low-level debugging

Seems that GDB is really a source debugger.  I.e. the "disassemble"
command can't be used on bare code.  For that you need the "x" examine
command, i.e. "x/10i $pc" will examine 10 units of data at $pc and
interpret them as instructions.

The next problem I ran into is setting breakpoints at raw instructions
instead of symbolic labels.  Just using "break" or "thbreak" doesn't
work.  Actually it does, it just needs some special syntax[1]
(mnemonic: code is a dereferenced code pointer).

  break *0x0000f000

( Related remark: it's possible to save current breakpoint
configuration as a script.  See "help breakpoints". )

[1] http://people.cs.uchicago.edu/~bomb154/154/maclabs/gdblab.html