Add WITH_DEBUG to build with debugging symbols

Fix a bug on amd64 where we would recurse infinitely on the stack frame
when parsing a signal frame

Submitted by:	jhb@
This commit is contained in:
Steven Kreuzer 2011-01-05 23:00:31 +00:00
parent db32bd6faa
commit 647c12d663
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=267435
2 changed files with 29 additions and 4 deletions

View file

@ -8,6 +8,7 @@
PORTNAME= gdb
PORTVERSION= 7.2
PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:S,$,:gdb,}
MASTER_SITE_SUBDIR=gdb/:gdb
@ -41,8 +42,14 @@ MAN1= gdb${VER}.1
ONLY_FOR_ARCHS= i386 amd64 # untested elsewhere, might work
OPTIONS= DEBUG "Build with debugging symbols" off
.include <bsd.port.pre.mk>
.if defined(WITH_DEBUG)
CFLAGS+= -g
.endif
# XXX: add OSVERSION check after readline is removed from base
.if exists(${LOCALBASE}/lib/libreadline.so)
LIB_DEPENDS+= readline.6:${PORTSDIR}/devel/readline

View file

@ -1,5 +1,5 @@
--- gdb/amd64fbsd-tdep.c.orig 2010-09-30 13:31:19.930008000 -0400
+++ gdb/amd64fbsd-tdep.c 2010-09-30 13:39:30.673331000 -0400
--- gdb/amd64fbsd-tdep.c.orig 2010-01-01 02:31:29.000000000 -0500
+++ gdb/amd64fbsd-tdep.c 2011-01-05 17:27:29.264869000 -0500
@@ -29,7 +29,6 @@
#include "gdb_string.h"
@ -8,7 +8,25 @@
#include "solib-svr4.h"
/* Support for signal handlers. */
@@ -142,46 +141,6 @@
@@ -40,12 +39,16 @@
static CORE_ADDR
amd64fbsd_sigcontext_addr (struct frame_info *this_frame)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR sp;
+ gdb_byte buf[8];
/* The `struct sigcontext' (which really is an `ucontext_t' on
FreeBSD/amd64) lives at a fixed offset in the signal frame. See
<machine/sigframe.h>. */
- sp = frame_unwind_register_unsigned (this_frame, AMD64_RSP_REGNUM);
+ get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
+ sp = extract_unsigned_integer (buf, 8, byte_order);
return sp + 16;
}
@@ -142,46 +145,6 @@
};
static void
@ -55,7 +73,7 @@
amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -201,10 +160,6 @@
@@ -201,10 +164,6 @@
tdep->sc_reg_offset = amd64fbsd_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (amd64fbsd_sc_reg_offset);