This is the mail archive of the
mailing list for the GDB project.
Re: Problem with GDB when debugging IRQ handlers
On Tue, Jun 28, 2011 at 03:54:11PM +0100, Dmitry Eremin-Solenikov wrote:
> On 6/28/11, Dmitry Eremin-Solenikov <email@example.com> wrote:
> > On 6/28/11, Catalin Marinas <firstname.lastname@example.org> wrote:
> >> Actually since the return address is in S_PC (which maybe gdb assumes it
> >> would be the saved LR), this is probably not be correct. After SVC
> >> entry, we have he following structure on the stack:
> >> ORIG_r0
> >> CPSR
> >> <--- assuming this is the Call Frame Address (SP+S_PC+4)
> >> PC <--- CFA - 4
> >> LR <--- don't care
> >> SP <--- CFA - 12
> >> ...
> >> So we tell gdb about this with something like below (untested):
> >> .cfi_def_cfa_offset S_PC + 4
> >> .cfi_offset 14, -4
> >> .cfi_offset 13, -12
> > This brings "unknown CFA rule" gdb exception, but it seems I got your idea.
> No, this seems to work, it was my fault. I got more or less reasonable
> backtrace now.
Does gdb manage to get into the parent stack frame?
BTW, are you compiling with FRAME_POINTER enabled? In this case you
would need to set some offset for the FP register (11). If you don't
mind missing the first part in the parent context, maybe something like
.cfi_offset 14, -4
.cfi_offset 13, -8
.cfi_offset 11, -16