From 117f631e54876035af27162ca11ea4e06601c8da Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 15 Dec 1992 18:12:37 +0000 Subject: [PATCH] Tue Dec 15 10:05:56 1992 Ian Lance Taylor (ian@cygnus.com) * coffread.c (decode_type): catch negative tagndx fields generated by SCO 3.2v4 cc. * exec.c: comment out string following #endif. * configure.in (i[34]86-*-sco3.2v4*): use host i386sco4. * xm-i386sco.h: include and , required by . * config/i386sco4.mh: new file; like i386sco.mh, but don't require gcc, and define const to empty to avoid SCO 3.2v4 cc bug. --- gdb/ChangeLog | 11 +++++++++++ gdb/coffread.c | 11 +++++++---- gdb/config/i386sco4.mh | 12 ++++++++++++ gdb/configure.in | 1 + gdb/exec.c | 10 ++++++---- gdb/xm-i386sco.h | 4 ++++ 6 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 gdb/config/i386sco4.mh diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c248d25c0ba..9fe599997c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +Tue Dec 15 10:05:56 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffread.c (decode_type): catch negative tagndx fields generated + by SCO 3.2v4 cc. + * exec.c: comment out string following #endif. + * configure.in (i[34]86-*-sco3.2v4*): use host i386sco4. + * xm-i386sco.h: include and , required by + . + * config/i386sco4.mh: new file; like i386sco.mh, but don't require + gcc, and define const to empty to avoid SCO 3.2v4 cc bug. + Tue Dec 15 04:14:24 1992 Fred Fish (fnf@cygnus.com) * complaints.c: New file, code moved from utils.c. diff --git a/gdb/coffread.c b/gdb/coffread.c index 6df64928776..6078b63c994 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1800,12 +1800,15 @@ decode_type (cs, c_type, aux) struct, union, and enum types. EPI a29k coff fakes us out by producing aux entries with a nonzero x_tagndx for definitions of structs, unions, and enums, so we - have to check the c_sclass field. */ + have to check the c_sclass field. SCO 3.2v4 cc gets confused + with pointers to pointers to defined structs, and generates + negative x_tagndx fields. */ if (cs->c_naux > 0 && aux->x_sym.x_tagndx.l != 0) { - if (cs->c_sclass != C_STRTAG - && cs->c_sclass != C_UNTAG - && cs->c_sclass != C_ENTAG) + if (cs->c_sclass != C_STRTAG + && cs->c_sclass != C_UNTAG + && cs->c_sclass != C_ENTAG + && aux->x_sym.x_tagndx.l >= 0) { type = coff_alloc_type (aux->x_sym.x_tagndx.l); return type; diff --git a/gdb/config/i386sco4.mh b/gdb/config/i386sco4.mh new file mode 100644 index 00000000000..8eb0657169f --- /dev/null +++ b/gdb/config/i386sco4.mh @@ -0,0 +1,12 @@ +# Host: Intel 386 running SCO Unix 3.2v4 +XDEPFILES= i387-tdep.o +XM_FILE= xm-i386sco.h +NAT_FILE= nm-i386sco.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o i386v-nat.o +XM_CLIBS= -lPW +SYSV_DEFINE=-DSYSV +REGEX=regex.o +REGEX1=regex.o +# The cc compiler mishandles const in cases like +# struct type ** const (c_builtin_types[]) = +MH_CFLAGS=-Dconst= diff --git a/gdb/configure.in b/gdb/configure.in index c5c389d9481..54f9cff707e 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -24,6 +24,7 @@ i[34]86-*-bsd*) gdb_host=i386bsd ;; i[34]86-*-go32) gdb_host=go32 ;; i[34]86-*-linux) gdb_host=linux ;; i[34]86-*-mach) gdb_host=i386mach ;; +i[34]86-*-sco3.2v4*) gdb_host=i386sco4 ;; i[34]86-*-sco*) gdb_host=i386sco ;; i[34]86-*-solaris*) gdb_host=i386sol2 ;; i[34]86-*-sunos*) gdb_host=sun386 ;; diff --git a/gdb/exec.c b/gdb/exec.c index 9e6167589b4..ef78097ea44 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -180,7 +180,7 @@ exec_file_command (args, from_tty) (*exec_file_display_hook) (filename); } else if (from_tty) - printf_filtered ("No exec file now.\n"); + printf ("No exec file now.\n"); } /* Set both the exec file and the symbol file, in one command. @@ -329,7 +329,7 @@ xfer_memory (memaddr, myaddr, len, write, target) wanna_xfer = coredata; } #endif /* REG_STACK_SEGMENT */ -#endif FIXME +#endif /* FIXME */ void print_section_info (t, abfd) @@ -408,7 +408,7 @@ struct target_ops exec_ops = { "Use an executable file as a target.\n\ Specify the filename of the executable file.", exec_file_command, exec_close, /* open, close */ - child_attach, 0, 0, 0, /* attach, detach, resume, wait, */ + find_default_attach, 0, 0, 0, /* attach, detach, resume, wait, */ 0, 0, /* fetch_registers, store_registers, */ 0, /* prepare_to_store, */ xfer_memory, exec_files_info, @@ -416,8 +416,10 @@ Specify the filename of the executable file.", 0, 0, 0, 0, 0, /* terminal stuff */ 0, 0, /* kill, load */ 0, /* lookup sym */ - child_create_inferior, + find_default_create_inferior, 0, /* mourn_inferior */ + 0, /* can_run */ + 0, /* notice_signals */ file_stratum, 0, /* next */ 0, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */ 0, 0, /* section pointers */ diff --git a/gdb/xm-i386sco.h b/gdb/xm-i386sco.h index 88870cabd44..8641ef6e1ff 100644 --- a/gdb/xm-i386sco.h +++ b/gdb/xm-i386sco.h @@ -17,6 +17,10 @@ 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. */ +/* In 3.2v4 requires on . */ +#include +#include + #include "xm-i386v.h" /* Apparently there is inconsistency among various System V's about what -- 2.30.2