This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Fix stack backtraces on 26-bit ARM
- To: <gdb-patches at sourceware dot cygnus dot com>
- Subject: Fix stack backtraces on 26-bit ARM
- From: Ben Harris <bjh21 at netbsd dot org>
- Date: Sat, 20 Oct 2001 17:51:41 +0100 (BST)
I'm trying to make GDB 5.0 work on NetBSD/arm26. One problem I've run
into is that even with "set apcs32 0", stack backtraces include flags in
the program counter for all frames apart from the top one. I think this
patch fixes the problem by using arm_addr_bits_remove() to clean up the
PC fetched from a stack frame. I'm not in a position to check this still
works on arm32 and thumb.
ChangeLog entry:
2001-10-20 Ben Harris <bjh21@netbsd.org>
* arm-tdep.c (arm_frame_saved_pc): Use arm_addr_bits_remove to
clean the PC. Necessary for backtraces in 26-bit modes.
Patch:
*** arm-tdep.c 2000/07/26 00:32:33 1.1.1.1
--- arm-tdep.c 2001/10/20 16:40:16
*************** arm_frame_saved_pc (struct frame_info *f
*** 1019,1025 ****
#endif
{
CORE_ADDR pc = arm_find_callers_reg (fi, LR_REGNUM);
! return IS_THUMB_ADDR (pc) ? UNMAKE_THUMB_ADDR (pc) : pc;
}
}
--- 1021,1027 ----
#endif
{
CORE_ADDR pc = arm_find_callers_reg (fi, LR_REGNUM);
! return arm_addr_bits_remove(pc);
}
}
--
Ben Harris <bjh21@netbsd.org>
Portmaster, NetBSD/arm26 <URL:http://www.netbsd.org/Ports/arm26/>