Backtracing broken core dumps

Catherine Smith
2009-07-19T16:03:55Z

I have attempted to find back traces of several core dumps
which have resulted from executing damaged pointers to
functions, or null pointers to functions.
Sometimes a gdb command of the form

set pc=$lr

would help, except that gdb says

(gdb) set pc=$lr
You can't do that without a process to debug

I have to resort to careful editting of the core file with a binary editor.
This works, is useful, but isn't very friendly.

Similarly today I had a crash in an Arm assembler memcpy() .
Careful unwinding the stack by hand and editting the core dump
allowed a stack trace to be extracted.

Is there a gdb command which allows this sort of change?
If not, could one be created?

Thanks,
John Smith