This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Arm, prepare custom frame for gdb.
- From: "dpc at ucore dot info" <dpc at ucore dot info>
- To: gdb at sourceware dot org
- Date: Wed, 25 May 2011 01:08:35 +0200
- Subject: Arm, prepare custom frame for gdb.
Hi,
I'm writing a ARM exception handlers, and I'd like to make gdb use the
interrupted code backtrace as ancestor of handling code. This would
allow to break on supervisor logic and `backtrace` command would
display the backtrace of interrupted non-supervisor code as well.
Obviously the handler is written in assembler. I'm dumping whole
context and moving on to C code that handles the required logic. When
I'm doing `backtrace` inside the C code, the backtrace is displayed to
the point of assembler code for exception entering and "Backtrace
stopped: previous frame identical to this frame (corrupt stack?)"
The C code is using virtual frame pointer (I think) as fp/ip does not
seem to be used on disassembled code. -O2 is causing -fomit-frame, I
guess.
I'm trying to put some values in ip / fp before calling C code so that
gdb recognizes dumped exception context as a stack frame and
interrupted code as a "caller". However without luck. It seems to me
that gdb does not use the hard frame (fp) registers in case of lacking
virtual frame pointers.
I suspect the following could be possible:
- add some linker symbols to assembler code so that gdb recognizes
dumped interrupt context as frame
- set some option in gdb so it uses fp for finding frame
or, might be, I just don't set the fp correctly (but I think I do).
Could anyone help me with an insights, links or example code how to
achieve what I've described?
Regards,
--
Dawid CiÄÅarkiewicz
http://ucore.info