From fbc3f1913d26d4b559cd51061444718a172b094a Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 9 Aug 1995 18:53:41 +0000 Subject: [PATCH] * configure.in (powerpc-*-aix*): Recognize as a new gdb host and target. (powerpc-*-eabi*): Don't set configdirs. (powerpcle-*-eabi*0: Likewise. * configure: Updated. * rs6000-nat.c (vmap_ldinfo): Don't relocate data addresses for the main objfile if DONT_RELOCATE_SYMFILE_OBJFILE is defined. * config/powerpc/{aix.mh,aix.mh}: Host and target makefile fragments for powerpc running aix4. * config/powerpc/{nm-aix.h, tm-ppc-aix.h, xm-aix.h}: Native, target and host include files for powerpc running aix4. More of Mike's powerpc work + minor changes. --- gdb/ChangeLog | 15 +++++ gdb/config/powerpc/.Sanitize | 11 +++- gdb/config/powerpc/nm-aix.h | 20 ++++++ gdb/config/powerpc/tm-ppc-aix.h | 31 ++++++++++ gdb/config/powerpc/xm-aix.h | 106 ++++++++++++++++++++++++++++++++ gdb/configure | 10 +-- gdb/configure.in | 10 +-- gdb/rs6000-nat.c | 10 +++ 8 files changed, 200 insertions(+), 13 deletions(-) create mode 100644 gdb/config/powerpc/nm-aix.h create mode 100644 gdb/config/powerpc/tm-ppc-aix.h create mode 100644 gdb/config/powerpc/xm-aix.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2d19bb9324..fa047fc5b3d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +Wed Aug 9 11:42:36 1995 Jeffrey A. Law + + * configure.in (powerpc-*-aix*): Recognize as a new gdb host + and target. + (powerpc-*-eabi*): Don't set configdirs. + (powerpcle-*-eabi*0: Likewise. + * configure: Updated. + * rs6000-nat.c (vmap_ldinfo): Don't relocate data addresses + for the main objfile if DONT_RELOCATE_SYMFILE_OBJFILE is + defined. + * config/powerpc/{aix.mh,aix.mh}: Host and target makefile fragments + for powerpc running aix4. + * config/powerpc/{nm-aix.h, tm-ppc-aix.h, xm-aix.h}: Native, target + and host include files for powerpc running aix4. + Wed Aug 9 08:11:45 1995 Stan Shebs * top.c (target_output_hook): Really make it match defs.h (char * diff --git a/gdb/config/powerpc/.Sanitize b/gdb/config/powerpc/.Sanitize index d4c3b81b108..0c242d66a57 100644 --- a/gdb/config/powerpc/.Sanitize +++ b/gdb/config/powerpc/.Sanitize @@ -21,13 +21,18 @@ Do-first: Things-to-keep: +aix.mh +aix.mt gdbserve.mt +nm-aix.h +ppc-eabi.mt ppc-nw.mt -tm-ppc-nw.h +ppcle-eabi.mt +tm-ppc-aix.h tm-ppc-eabi.h +tm-ppc-nw.h tm-ppcle-eabi.h -ppc-eabi.mt -ppcle-eabi.mt +xm-aix.h Things-to-lose: diff --git a/gdb/config/powerpc/nm-aix.h b/gdb/config/powerpc/nm-aix.h new file mode 100644 index 00000000000..f9ce9344fd4 --- /dev/null +++ b/gdb/config/powerpc/nm-aix.h @@ -0,0 +1,20 @@ +/* IBM PowerPC native-dependent macros for GDB, the GNU debugger. + Copyright 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include "rs6000/nm-rs6000.h" diff --git a/gdb/config/powerpc/tm-ppc-aix.h b/gdb/config/powerpc/tm-ppc-aix.h new file mode 100644 index 00000000000..d4853e6fced --- /dev/null +++ b/gdb/config/powerpc/tm-ppc-aix.h @@ -0,0 +1,31 @@ +/* Macro definitions for Power PC running AIX. + Copyright 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef TM_PPC_AIX_H +#define TM_PPC_AIX_H + +/* The main executable doesn't need relocation in aix4. */ +#define DONT_RELOCATE_SYMFILE_OBJFILE + +/* Use generic RS6000 definitions. */ +#include "rs6000/tm-rs6000.h" + +#define GDB_TARGET_POWERPC + +#endif /* TM_PPC_AIX_H */ diff --git a/gdb/config/powerpc/xm-aix.h b/gdb/config/powerpc/xm-aix.h new file mode 100644 index 00000000000..8481060e16d --- /dev/null +++ b/gdb/config/powerpc/xm-aix.h @@ -0,0 +1,106 @@ +/* Parameters for hosting on an PowerPC, for GDB, the GNU debugger. + Copyright 1995 Free Software Foundation, Inc. + Contributed by Cygnus Corporation. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* The following text is taken from config/rs6000.mh: + * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says + * # `extern fd_set svc_fdset;' without ever defining the type fd_set. + * # Unfortunately this occurs in the vx-share code, which is not configured + * # like the rest of GDB (e.g. it doesn't include "defs.h"). + * # We circumvent this bug by #define-ing fd_set here, but undefining it in + * # the xm-rs6000.h file before ordinary modules try to use it. FIXME, IBM! + * MH_CFLAGS='-Dfd_set=int' + * So, here we do the undefine...which has to occur before we include + * below. + */ +#undef fd_set + +#include + +/* Big end is at the low address */ + +#define HOST_BYTE_ORDER BIG_ENDIAN + +/* At least as of AIX 3.2, we have termios. */ +#define HAVE_TERMIOS 1 +/* #define HAVE_TERMIO 1 */ + +#define USG 1 +#define HAVE_SIGSETMASK 1 + +/* AIX declares the mem functions differently than defs.h does. AIX is + right, but defs.h works on more old systems. For now, override it. */ + +#define MEM_FNS_DECLARED 1 + +/* This system requires that we open a terminal with O_NOCTTY for it to + not become our controlling terminal. */ + +#define USE_O_NOCTTY + +/* Brain death inherited from PC's pervades. */ +#undef NULL +#define NULL 0 + +/* The IBM compiler requires this in order to properly compile alloca(). */ +#pragma alloca + +/* There is no vfork. */ + +#define vfork fork + +/* Setpgrp() takes arguments, unlike ordinary Sys V's. */ + +/* #define SETPGRP_ARGS 1 */ + +#if 0 +/* AIX doesn't have strdup, so we need to declare it for libiberty */ +extern char *strdup PARAMS ((char *)); +#endif + +/* Signal handler for SIGWINCH `window size changed'. */ + +#define SIGWINCH_HANDLER aix_resizewindow +extern void aix_resizewindow (); + +/* This doesn't seem to be declared in any header file I can find. */ +char *termdef PARAMS ((int, int)); + +/* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */ + +#define SIGWINCH_HANDLER_BODY \ + \ +/* Respond to SIGWINCH `window size changed' signal, and reset GDB's \ + window settings approproatelt. */ \ + \ +void \ +aix_resizewindow () \ +{ \ + int fd = fileno (stdout); \ + if (isatty (fd)) { \ + int val; \ + \ + val = atoi (termdef (fd, 'l')); \ + if (val > 0) \ + lines_per_page = val; \ + val = atoi (termdef (fd, 'c')); \ + if (val > 0) \ + chars_per_line = val; \ + } \ +} diff --git a/gdb/configure b/gdb/configure index b3fce48920e..0158056d2dd 100755 --- a/gdb/configure +++ b/gdb/configure @@ -1943,6 +1943,8 @@ ns32k-*-netbsd*) gdb_host=nbsd ;; ns32k-umax-*) gdb_host=umax ;; ns32k-utek-sysv*) gdb_host=merlin ;; +powerpc-*-aix*) gdb_host=aix ;; + pn-*-*) gdb_host=pn ;; pyramid-*-*) gdb_host=pyramid ;; @@ -2137,11 +2139,9 @@ pn-*-*) gdb_target=pn ;; powerpc-*-netware*) gdb_target=ppc-nw configdirs="${configdirs} nlm" ;; -powerpc-*-eabi*) gdb_target=ppc-eabi - configdirs="${configdirs}" ;; - -powerpcle-*-eabi*) gdb_target=ppcle-eabi - configdirs="${configdirs}" ;; +powerpc-*-aix*) gdb_target=aix ;; +powerpc-*-eabi*) gdb_target=ppc-eabi ;; +powerpcle-*-eabi*) gdb_target=ppcle-eabi ;; pyramid-*-*) gdb_target=pyramid ;; diff --git a/gdb/configure.in b/gdb/configure.in index 6f0b7d4b938..627b2d53979 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -183,6 +183,8 @@ ns32k-*-netbsd*) gdb_host=nbsd ;; ns32k-umax-*) gdb_host=umax ;; ns32k-utek-sysv*) gdb_host=merlin ;; +powerpc-*-aix*) gdb_host=aix ;; + pn-*-*) gdb_host=pn ;; pyramid-*-*) gdb_host=pyramid ;; @@ -377,11 +379,9 @@ pn-*-*) gdb_target=pn ;; powerpc-*-netware*) gdb_target=ppc-nw configdirs="${configdirs} nlm" ;; -powerpc-*-eabi*) gdb_target=ppc-eabi - configdirs="${configdirs}" ;; - -powerpcle-*-eabi*) gdb_target=ppcle-eabi - configdirs="${configdirs}" ;; +powerpc-*-aix*) gdb_target=aix ;; +powerpc-*-eabi*) gdb_target=ppc-eabi ;; +powerpcle-*-eabi*) gdb_target=ppcle-eabi ;; pyramid-*-*) gdb_target=pyramid ;; diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 18bce296380..a5fec6cb835 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -500,6 +500,16 @@ vmap_ldinfo (ldi) if (vp->objfile == NULL) got_exec_file = 1; +#ifdef DONT_RELOCATE_SYMFILE_OBJFILE + if (vp->objfile == symfile_objfile + || vp->objfile == NULL) + { + ldi->ldinfo_dataorg = 0; + vp->dstart = (CORE_ADDR) 0; + vp->dend = ldi->ldinfo_datasize; + } +#endif + /* relocate symbol table(s). */ vmap_symtab (vp); -- 2.30.2