Get function names from call stack

You should have a copy of arm-eabi-addr2line available in the NDK bin directory. You can use this with a command like: arm-eabi-addr2line -f -e /path/to/lib/with/symbols.so 0x001fb18a That will crawl through the debug symbols in the shared lib to get file and line number information. For best results hand it a library that hasn’t had the … Read more

How to get a “codesigned” gdb on OSX?

I.1 Codesigning the Debugger The Darwin Kernel requires the debugger to have special permissions before it is allowed to control other processes. These permissions are granted by codesigning the GDB executable. Without these permissions, the debugger will report error messages such as: Starting program: /x/y/foo Unable to find Mach task port for process-id 28885: (os/kern) … Read more

How to set breakpoints on future shared libraries with a command flag

Replying to myself, I’d like to give the answer that someone gave me on IRC: (gdb) apropos pending actions — Specify the actions to be taken at a tracepoint set breakpoint — Breakpoint specific settings set breakpoint pending — Set debugger’s behavior regarding pending breakpoints show breakpoint — Breakpoint specific settings show breakpoint pending — … Read more

How to modify memory contents using GDB?

The easiest is setting a program variable (see GDB: assignment): (gdb) l 6 { 7 int i; 8 struct file *f, *ftmp; 9 (gdb) set variable i = 10 (gdb) p i $1 = 10 Or you can just update arbitrary (writable) location by address: (gdb) set {int}0x83040 = 4 There’s more. Read the manual.