Add support for ELF shared libraries. Also use bfd from the binutils in that
case rather than gdb's own copy.
This commit is contained in:
parent
9890b24c74
commit
0f9bd807c9
|
@ -1,12 +1,21 @@
|
|||
# $Id: Makefile,v 1.30 1998/03/07 08:54:42 bde Exp $
|
||||
# $Id: Makefile,v 1.31 1998/03/19 15:21:19 bde Exp $
|
||||
|
||||
PROG = gdb
|
||||
|
||||
GDBDIR= ${.CURDIR}/../../../../contrib/gdb
|
||||
.if ${BINFORMAT} == elf
|
||||
BFDDIR= ${.CURDIR}/../../binutils/libbfd/${MACHINE_ARCH}
|
||||
.else
|
||||
BFDDIR= ${.CURDIR}/../bfd
|
||||
.endif
|
||||
.PATH: ${GDBDIR}/gdb
|
||||
.PATH: ${GDBDIR}/opcodes
|
||||
|
||||
BINDIR= /usr/bin
|
||||
.if ${BINFORMAT} == elf
|
||||
CFLAGS+= -DFREEBSD_ELF
|
||||
.endif
|
||||
|
||||
BINDIR?= /usr/bin
|
||||
XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
|
||||
c-typeprint.c c-valprint.c ch-lang.c ch-typeprint.c \
|
||||
ch-valprint.c coffread.c command.c complaints.c copying.c \
|
||||
|
@ -32,7 +41,7 @@ XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
|
|||
XSRCS+= i386-dis.c dis-buf.c disassemble.c
|
||||
SRCS= init.c ${XSRCS}
|
||||
|
||||
CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I$(.CURDIR)/../bfd
|
||||
CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I${BFDDIR}
|
||||
# use phkmalloc
|
||||
CFLAGS+= -DNO_MMALLOC
|
||||
# uncomment the next line if you want to debug gdb
|
||||
|
@ -40,6 +49,22 @@ CFLAGS+= -DNO_MMALLOC
|
|||
|
||||
CLEANFILES+= c-exp.c f-exp.c m2-exp.c init.c y.tab.h init.c-tmp
|
||||
|
||||
.if ${BINFORMAT} == elf
|
||||
|
||||
.if exists(${.OBJDIR}/../../binutils/libbfd)
|
||||
LIBBFD= ${.OBJDIR}/../../binutils/libbfd/libbfd.a
|
||||
.else
|
||||
LIBBFD= ${.CURDIR}/../../binutils/libbfd/libbfd.a
|
||||
.endif
|
||||
|
||||
.if exists(${.OBJDIR}/../../binutils/libiberty)
|
||||
LIBIBERTY= ${.OBJDIR}/../../binutils/libiberty/libiberty.a
|
||||
.else
|
||||
LIBIBERTY= ${.CURDIR}/../../binutils/libiberty/libiberty.a
|
||||
.endif
|
||||
|
||||
.else
|
||||
|
||||
.if exists(${.OBJDIR}/../bfd)
|
||||
LIBBFD= ${.OBJDIR}/../bfd/libbfd.a
|
||||
.else
|
||||
|
@ -52,6 +77,8 @@ LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
|
|||
LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
|
||||
.endif
|
||||
|
||||
.endif # BINFORMAT
|
||||
|
||||
DPADD= ${LIBBFD} ${LIBREADLINE} ${LIBGNUREGEX} ${LIBIBERTY} ${LIBTERMCAP}
|
||||
LDADD= ${LIBBFD} -lreadline -lgnuregex ${LIBIBERTY} -ltermcap
|
||||
DPADD+= ${LIBIBERTY}
|
||||
|
|
|
@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
/* Be shared lib aware */
|
||||
#include "solib.h"
|
||||
#ifdef FREEBSD_ELF
|
||||
#define SVR4_SHARED_LIBS
|
||||
#endif
|
||||
|
||||
/* This is the amount to subtract from u.u_ar0
|
||||
to get the offset in the core file of the register values. */
|
||||
|
@ -42,6 +45,8 @@ i386_register_u_addr PARAMS ((int, int));
|
|||
|
||||
#define PTRACE_ARG3_TYPE char*
|
||||
|
||||
#ifndef FREEBSD_ELF
|
||||
|
||||
/* make structure definitions match up with those expected in solib.c */
|
||||
#define link_object sod
|
||||
#define lo_name sod_name
|
||||
|
@ -95,6 +100,8 @@ i386_register_u_addr PARAMS ((int, int));
|
|||
#define ld_un d_un
|
||||
#define ld_2 d_sdt
|
||||
|
||||
#endif
|
||||
|
||||
/* Return sizeof user struct to callers in less machine dependent routines */
|
||||
|
||||
#define KERNEL_U_SIZE kernel_u_size()
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
# $Id: Makefile,v 1.30 1998/03/07 08:54:42 bde Exp $
|
||||
# $Id: Makefile,v 1.31 1998/03/19 15:21:19 bde Exp $
|
||||
|
||||
PROG = gdb
|
||||
|
||||
GDBDIR= ${.CURDIR}/../../../../contrib/gdb
|
||||
.if ${BINFORMAT} == elf
|
||||
BFDDIR= ${.CURDIR}/../../binutils/libbfd/${MACHINE_ARCH}
|
||||
.else
|
||||
BFDDIR= ${.CURDIR}/../bfd
|
||||
.endif
|
||||
.PATH: ${GDBDIR}/gdb
|
||||
.PATH: ${GDBDIR}/opcodes
|
||||
|
||||
BINDIR= /usr/bin
|
||||
.if ${BINFORMAT} == elf
|
||||
CFLAGS+= -DFREEBSD_ELF
|
||||
.endif
|
||||
|
||||
BINDIR?= /usr/bin
|
||||
XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
|
||||
c-typeprint.c c-valprint.c ch-lang.c ch-typeprint.c \
|
||||
ch-valprint.c coffread.c command.c complaints.c copying.c \
|
||||
|
@ -32,7 +41,7 @@ XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
|
|||
XSRCS+= i386-dis.c dis-buf.c disassemble.c
|
||||
SRCS= init.c ${XSRCS}
|
||||
|
||||
CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I$(.CURDIR)/../bfd
|
||||
CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I${BFDDIR}
|
||||
# use phkmalloc
|
||||
CFLAGS+= -DNO_MMALLOC
|
||||
# uncomment the next line if you want to debug gdb
|
||||
|
@ -40,6 +49,22 @@ CFLAGS+= -DNO_MMALLOC
|
|||
|
||||
CLEANFILES+= c-exp.c f-exp.c m2-exp.c init.c y.tab.h init.c-tmp
|
||||
|
||||
.if ${BINFORMAT} == elf
|
||||
|
||||
.if exists(${.OBJDIR}/../../binutils/libbfd)
|
||||
LIBBFD= ${.OBJDIR}/../../binutils/libbfd/libbfd.a
|
||||
.else
|
||||
LIBBFD= ${.CURDIR}/../../binutils/libbfd/libbfd.a
|
||||
.endif
|
||||
|
||||
.if exists(${.OBJDIR}/../../binutils/libiberty)
|
||||
LIBIBERTY= ${.OBJDIR}/../../binutils/libiberty/libiberty.a
|
||||
.else
|
||||
LIBIBERTY= ${.CURDIR}/../../binutils/libiberty/libiberty.a
|
||||
.endif
|
||||
|
||||
.else
|
||||
|
||||
.if exists(${.OBJDIR}/../bfd)
|
||||
LIBBFD= ${.OBJDIR}/../bfd/libbfd.a
|
||||
.else
|
||||
|
@ -52,6 +77,8 @@ LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
|
|||
LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
|
||||
.endif
|
||||
|
||||
.endif # BINFORMAT
|
||||
|
||||
DPADD= ${LIBBFD} ${LIBREADLINE} ${LIBGNUREGEX} ${LIBIBERTY} ${LIBTERMCAP}
|
||||
LDADD= ${LIBBFD} -lreadline -lgnuregex ${LIBIBERTY} -ltermcap
|
||||
DPADD+= ${LIBIBERTY}
|
||||
|
|
|
@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
|
||||
/* Be shared lib aware */
|
||||
#include "solib.h"
|
||||
#ifdef FREEBSD_ELF
|
||||
#define SVR4_SHARED_LIBS
|
||||
#endif
|
||||
|
||||
/* This is the amount to subtract from u.u_ar0
|
||||
to get the offset in the core file of the register values. */
|
||||
|
@ -42,6 +45,8 @@ i386_register_u_addr PARAMS ((int, int));
|
|||
|
||||
#define PTRACE_ARG3_TYPE char*
|
||||
|
||||
#ifndef FREEBSD_ELF
|
||||
|
||||
/* make structure definitions match up with those expected in solib.c */
|
||||
#define link_object sod
|
||||
#define lo_name sod_name
|
||||
|
@ -95,6 +100,8 @@ i386_register_u_addr PARAMS ((int, int));
|
|||
#define ld_un d_un
|
||||
#define ld_2 d_sdt
|
||||
|
||||
#endif
|
||||
|
||||
/* Return sizeof user struct to callers in less machine dependent routines */
|
||||
|
||||
#define KERNEL_U_SIZE kernel_u_size()
|
||||
|
|
Loading…
Reference in New Issue