aboutsummaryrefslogtreecommitdiff
path: root/devel/gdb
diff options
context:
space:
mode:
authorSteven Kreuzer <skreuzer@FreeBSD.org>2011-01-05 23:00:31 +0000
committerSteven Kreuzer <skreuzer@FreeBSD.org>2011-01-05 23:00:31 +0000
commit647c12d663bd63bf8e2112a4328d508d326810fb (patch)
tree51a661bc6e77190e804882af8d67df8c94a33a37 /devel/gdb
parentdb32bd6faaad2c029a5f2ab245c6143580e49415 (diff)
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@
Notes
Notes: svn path=/head/; revision=267435
Diffstat (limited to 'devel/gdb')
-rw-r--r--devel/gdb/Makefile7
-rw-r--r--devel/gdb/files/patch-gdb-amd64fbsd-tdep.c26
2 files changed, 29 insertions, 4 deletions
diff --git a/devel/gdb/Makefile b/devel/gdb/Makefile
index a18d56741b28..309b339df7ae 100644
--- a/devel/gdb/Makefile
+++ b/devel/gdb/Makefile
@@ -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
diff --git a/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c b/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c
index 7f0f87d98a48..09e930b1f772 100644
--- a/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c
+++ b/devel/gdb/files/patch-gdb-amd64fbsd-tdep.c
@@ -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);