From 8c6e9f05f2ba8e0211862d77b9f54f1ac7e4538d Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Sat, 30 Nov 1991 04:46:50 +0000 Subject: [PATCH] Add tm-i386v4.h and xm-i386v4.h to Sanitize, add i386/SVR4 to configuration file, recognize names beginning with '.' as compiler generated "fake" tags for anonymous structures, unions and enums. Add target dependent functions for SVR4 /proc register interface (i386-tdep.c). --- gdb/.Sanitize | 2 ++ gdb/ChangeLog | 18 ++++++++++++++++++ gdb/configure.in | 2 ++ gdb/dwarfread.c | 8 ++++++-- gdb/tm-i386v.h | 6 +++++- gdb/tm-i386v4.h | 38 ++++++++++++++++++++++++++++++++++++++ gdb/xm-i386v4.h | 28 ++++++++++++++++++++++++++++ 7 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 gdb/tm-i386v4.h create mode 100644 gdb/xm-i386v4.h diff --git a/gdb/.Sanitize b/gdb/.Sanitize index 097dffe7f30..b9f49147e35 100644 --- a/gdb/.Sanitize +++ b/gdb/.Sanitize @@ -201,6 +201,7 @@ tm-hp300bsd.h tm-hp300hpux.h tm-i386v-g.h tm-i386v.h +tm-i386v4.h tm-i960.h tm-irix3.h tm-isi.h @@ -254,6 +255,7 @@ xm-hp300hpux.h xm-i386mach.h xm-i386sco.h xm-i386v.h +xm-i386v4.h xm-i386v32.h xm-irix3.h xm-isi.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 14e48730393..3464fc72006 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,23 @@ Fri Nov 29 16:59:25 1991 Fred Fish (fnf at cygnus.com) + * configure.in: Add SVR4 i386 configurations. + + * config/mh-i386v4, config/mt-i386v4, tm-i386v4.h, xm-i386v4.h: + New files for i386/SVR4. + + * tm-i386v.h: Allow START_INFERIOR_TRAPS_EXPECTED and + DECR_PC_AFTER_BREAK to be predefined by files including + tm-i386v.h. + + * i386-tdep.c: Add supply_gregset(), fill_gregset(), + supply_fpregset(), and fill_fpregset() functions, which are + target dependent support functions for the SVR4 /proc register + interface. + + * dwarfread.c (enum_type, struct_type): Expand recognized + compiler generated tags to include symbols beginning with '.' as + well as '~'. + * symtab.c (sources_info): Change simple printf of error message to call to error(). diff --git a/gdb/configure.in b/gdb/configure.in index 22af8868f5b..81d11934af2 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -86,6 +86,7 @@ i386) case "${host_os}" in sysv) gdb_host=i386v ;; sysv32) gdb_host=i386v32 ;; + svr4) gdb_host=i386v4 ;; mach) gdb_host=i386mach ;; esac ;; @@ -242,6 +243,7 @@ i386) case "${target_os}" in sysv) gdb_target=i386v ;; sysv32) gdb_target=i386v32 ;; + svr4) gdb_target=i386v4 ;; mach) gdb_target=i386mach ;; coff) gdb_target=i386v ;; aout) gdb_target=i386aout ;; diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index fcc2f352ce4..4fb1ddb31c5 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -926,7 +926,9 @@ DEFUN(struct_type, (dip, thisdie, enddie), } /* Some compilers try to be helpful by inventing "fake" names for anonymous enums, structures, and unions, like "~0fake". Thanks, but no thanks. */ - if (dip -> at_name == NULL || *dip -> at_name == '~') + if (dip -> at_name == NULL + || *dip -> at_name == '~' + || *dip -> at_name == '.') { tpart2 = "{...}"; } @@ -1345,7 +1347,9 @@ DEFUN(enum_type, (dip), struct dieinfo *dip) tpart1 = "enum "; /* Some compilers try to be helpful by inventing "fake" names for anonymous enums, structures, and unions, like "~0fake". Thanks, but no thanks. */ - if (dip -> at_name == NULL || *dip -> at_name == '~') + if (dip -> at_name == NULL + || *dip -> at_name == '~' + || *dip -> at_name == '.') { tpart2 = "{...}"; } else { diff --git a/gdb/tm-i386v.h b/gdb/tm-i386v.h index 409cc535ffc..1cee572b815 100644 --- a/gdb/tm-i386v.h +++ b/gdb/tm-i386v.h @@ -1,4 +1,4 @@ -/* Macro defintions for i386. +/* Macro definitions for i386, Unix System V. Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. This file is part of GDB. @@ -42,7 +42,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ * to run an inferior, and when we finally get to * the inferior code. This is 2 on most implementations. */ +#ifndef START_INFERIOR_TRAPS_EXPECTED #define START_INFERIOR_TRAPS_EXPECTED 4 +#endif /* Offset from address of function to start of its code. Zero on most machines. */ @@ -78,7 +80,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ This is often the number of bytes in BREAKPOINT but not always. */ +#ifndef DECR_PC_AFTER_BREAK #define DECR_PC_AFTER_BREAK 1 +#endif /* Nonzero if instruction at PC is a return instruction. */ diff --git a/gdb/tm-i386v4.h b/gdb/tm-i386v4.h new file mode 100644 index 00000000000..33bb75fb607 --- /dev/null +++ b/gdb/tm-i386v4.h @@ -0,0 +1,38 @@ +/* Macro definitions for GDB on an Intel i386 running SVR4. + Copyright (C) 1991, Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support (fnf@cygint) + +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. */ + +/* Use the alternate method of determining valid frame chains. */ + +#define FRAME_CHAIN_VALID_ALTERNATE + +/* number of traps that happen between exec'ing the shell + * to run an inferior, and when we finally get to + * the inferior code. This is 2 on most implementations. + */ +#define START_INFERIOR_TRAPS_EXPECTED 2 + +#include "tm-svr4.h" +#include "tm-i386v.h" + +/* We can't tell how many args there are + now that the C compiler delays popping them. */ + +#undef FRAME_NUM_ARGS +#define FRAME_NUM_ARGS(val,fi) (val = -1) diff --git a/gdb/xm-i386v4.h b/gdb/xm-i386v4.h new file mode 100644 index 00000000000..0b54b59fe75 --- /dev/null +++ b/gdb/xm-i386v4.h @@ -0,0 +1,28 @@ +/* Macro definitions for GDB on an Intel i386 running SVR4. + Copyright (C) 1991, Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support (fnf@cygint) + +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. */ + +/* Pick up most of what we need from the generic i386 host include file. */ + +#include "xm-i386v.h" + +/* Pick up more stuff from the generic SVR4 host include file. */ + +#include "xm-svr4.h" + -- 2.30.2