Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!munnari!sibyl.eleceng.ua.oz.au!ian From: munnari!sibyl.eleceng.ua.oz.au!ian@UUNET.UU.NET Newsgroups: gnu.gdb.bug Subject: GDB: support for vanilla System V (part 3 of 5) Message-ID: <8811301737.AA11922@uunet.UU.NET> Date: 1 Dec 88 05:23:52 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 719 (Sorry if you've seen this before but I sent it to bug-gnu-emacs not realising that bug-gdb existed) In GDB 2.7 on sibyl (usg-unix-v) There are 5 parts because outgoing overseas mail from here must be less than 25k. Part 1 contains a shar archive containing the new files. Parts 2 to 5 contain shar archives of the patch files to make the changes to the the existing files. The patch files are context differences. Part 3 of 5: --------------Cut Here----------------------- # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by ian on Thu Nov 24 11:20:05 CST 1988 # Contents: patch#2 echo x - patch#2 sed 's/^@//' > "patch#2" <<'@//E*O*F patch#2//' *** ../gdb.dist/coffread.c Wed Jul 13 14:12:46 1988 --- coffread.c Wed Nov 23 10:33:11 1988 *************** *** 21,26 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "param.h" #ifdef COFF_FORMAT --- 21,27 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "param.h" #ifdef COFF_FORMAT *************** *** 28,33 #include "symtab.h" #include#include #include #include --- 29,35 ----- #include "symtab.h" #include + #include #include #include #include *************** *** 31,36 #include #include #include #include static void add_symbol_to_list (); --- 33,44 ----- #include #include #include + #ifdef NS5 + #include + #include + #define NS32GMAGIC (0524) + #define NS32SMAGIC (0525) + #endif #include static void add_symbol_to_list (); *************** *** 77,82 static FILE *nlist_stream_global; static int nlist_nsyms_global; /* The file and text section headers of the symbol file */ static FILHDR file_hdr; --- 85,93 ----- static FILE *nlist_stream_global; static int nlist_nsyms_global; + /* Total number of symbols in the coff executable */ + static int num_symbols; + /* The file and text section headers of the symbol file */ static FILHDR file_hdr; *************** *** 635,641 char *name; { int desc; - int num_symbols; int num_sections; int symtab_offset; extern void close (); --- 646,651 ----- char *name; { int desc; int num_sections; int symtab_offset; extern void close (); *************** *** 683,689 return; } ! printf ("Reading symbol data from %s...", name); fflush (stdout); /* Throw away the old symbol table. */ --- 693,699 ----- return; } ! printf ("Reading symbol data from %s...\n", name); fflush (stdout); /* Throw away the old symbol table. */ *************** *** 694,700 symtab_offset = file_hdr.f_symptr; if (read_section_hdr (desc, _TEXT, &text_hdr, num_sections) < 0) ! error ("\"%s\": can't read text section header", name); /* Read the line number table, all at once. */ --- 704,710 ----- symtab_offset = file_hdr.f_symptr; if (read_section_hdr (desc, _TEXT, &text_hdr, num_sections) < 0) ! error ("\"%s\": can't read text section header", name); /* Read the line number table, all at once. */ *************** *** 700,706 val = init_lineno (desc, text_hdr.s_lnnoptr, text_hdr.s_nlnno); if (val < 0) ! error ("\"%s\": error reading line numbers\n", name); /* Now read the string table, all at once. */ --- 710,716 ----- val = init_lineno (desc, text_hdr.s_lnnoptr, text_hdr.s_nlnno); if (val < 0) ! error ("\"%s\": error reading line numbers\n", name); /* Now read the string table, all at once. */ *************** *** 1531,1538 return type; } ! /* Reference to existing type */ ! if (cs->c_nsyms > 1 && aux->x_sym.x_tagndx != 0) { type = coff_alloc_type (aux->x_sym.x_tagndx); return type; --- 1541,1553 ----- return type; } ! /* Reference to existing type (base type)*/ ! ! if (cs->c_nsyms > 1 ! && cs->c_sclass != C_FILE && cs->c_sclass != C_STAT ! && cs->c_sclass != C_STRTAG && cs->c_sclass != C_UNTAG ! && cs->c_sclass != C_ENTAG && cs->c_sclass != C_BLOCK ! && aux->x_sym.x_tagndx != 0) { /* Do some sanity checking */ if ( aux->x_sym.x_tagndx < num_symbols) *************** *** 1534,1541 /* Reference to existing type */ if (cs->c_nsyms > 1 && aux->x_sym.x_tagndx != 0) { ! type = coff_alloc_type (aux->x_sym.x_tagndx); ! return type; } return decode_base_type (cs, BTYPE (c_type), aux); --- 1549,1562 ----- && cs->c_sclass != C_ENTAG && cs->c_sclass != C_BLOCK && aux->x_sym.x_tagndx != 0) { ! /* Do some sanity checking */ ! if ( aux->x_sym.x_tagndx < num_symbols) ! { ! type = coff_alloc_type (aux->x_sym.x_tagndx); ! return type; ! } ! else ! printf ("Warning: bad symbol table. Ignoring aux entry for %s ( %d )\n", cs->c_name, aux->x_sym.x_tagndx); } return decode_base_type (cs, BTYPE (c_type), aux); *************** *** 1571,1578 switch (c_type) { case T_NULL: ! /* shouldn't show up here */ ! break; case T_ARG: /* shouldn't show up here */ --- 1592,1598 ----- switch (c_type) { case T_NULL: ! return builtin_type_void; /* Functions might have this */ case T_ARG: /* shouldn't show up here */ *************** *** 1655,1661 case T_ULONG: return builtin_type_unsigned_long; } ! printf ("unexpected type %d at symnum %d\n", c_type, cs->c_symnum); return builtin_type_void; } --- 1675,1682 ----- case T_ULONG: return builtin_type_unsigned_long; } ! printf ("unexpected type %d of %s ( symnum %d ), class %d\n" ! , c_type, cs->c_name, cs->c_symnum, cs->c_sclass); return builtin_type_void; } *** ../gdb.dist/command.c Sat Mar 26 10:12:00 1988 --- command.c Wed Nov 9 02:03:33 1988 *************** *** 103,108 what you give them. Help stamp out software-hoarding! */ #include "command.h" #include --- 103,109 ----- what you give them. Help stamp out software-hoarding! */ + #include "config.h" #include "command.h" #include *** ../gdb.dist/core.c Wed May 4 01:20:35 1988 --- core.c Thu Nov 24 00:07:08 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "initialize.h" #include "defs.h" #include "param.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "initialize.h" #include "defs.h" #include "param.h" *************** *** 26,31 #include #include #include #include #include #include --- 27,36 ----- #include #include #include + #ifdef NS5 + #include + #include + #endif #include #include #include *************** *** 33,38 /* Recognize COFF format systems because a.out.h defines AOUTHDR. */ #ifdef AOUTHDR #define COFF_FORMAT #endif #ifdef NEW_SUN_CORE --- 38,45 ----- /* Recognize COFF format systems because a.out.h defines AOUTHDR. */ #ifdef AOUTHDR #define COFF_FORMAT + #ifndef PAGESIZE + #define PAGESIZE NBPG #endif #endif *************** *** 34,39 #ifdef AOUTHDR #define COFF_FORMAT #endif #ifdef NEW_SUN_CORE #include --- 41,47 ----- #ifndef PAGESIZE #define PAGESIZE NBPG #endif + #endif #ifdef NEW_SUN_CORE #include *************** *** 149,155 static void validate_files (); unsigned int register_addr (); ! core_file_command (filename, from_tty) char *filename; int from_tty; { --- 157,163 ----- static void validate_files (); unsigned int register_addr (); ! void core_file_command (filename, from_tty) char *filename; int from_tty; { *************** *** 252,261 ? sys_siglist[u.pt_signal] : "(undocumented)"); #else /* not UMAX_CORE */ ! data_end = data_start + NBPG * u.u_dsize; ! stack_start = stack_end - NBPG * u.u_ssize; ! data_offset = NBPG * UPAGES; ! stack_offset = NBPG * (UPAGES + u.u_dsize); reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; /* I don't know where to find this info. --- 260,278 ----- ? sys_siglist[u.pt_signal] : "(undocumented)"); #else /* not UMAX_CORE */ ! ! /* At this point data_start will be zero if we haven't loaded an ! executable file */ ! #ifdef NS5 ! if (! data_start) data_start = u.u_datorg; ! #endif ! data_end = data_start + PAGESIZE * u.u_dsize; ! stack_start = stack_end - PAGESIZE * u.u_ssize; ! data_offset = PAGESIZE * USIZE; ! #ifdef NS5 ! data_offset += data_start & (PAGESIZE - 1); ! #endif ! stack_offset = PAGESIZE * (u.u_dsize + USIZE); reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; /* I don't know where to find this info. *************** *** 333,338 else if (from_tty) printf ("No core file now.\n"); } exec_file_command (filename, from_tty) char *filename; --- 350,356 ----- else if (from_tty) printf ("No core file now.\n"); } + void exec_file_command (filename, from_tty) char *filename; *************** *** 334,340 printf ("No core file now.\n"); } ! exec_file_command (filename, from_tty) char *filename; int from_tty; { --- 352,358 ----- } ! void exec_file_command (filename, from_tty) char *filename; int from_tty; { *** ../gdb.dist/dbxread.c Thu Jul 7 16:02:06 1988 --- dbxread.c Wed Nov 9 02:03:28 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "param.h" #ifdef READ_DBX_FORMAT --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "param.h" #ifdef READ_DBX_FORMAT *** ../gdb.dist/environ.c Fri Feb 12 10:24:40 1988 --- environ.c Wed Nov 9 02:03:21 1988 *************** *** 100,105 In other words, feel free to share this program, but don't try to stop anyone else from sharing it. */ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) --- 100,107 ----- In other words, feel free to share this program, but don't try to stop anyone else from sharing it. */ + #include "config.h" + #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) *** ../gdb.dist/eval.c Thu Feb 4 04:33:36 1988 --- eval.c Wed Nov 9 02:03:19 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "initialize.h" #include "symtab.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "initialize.h" #include "symtab.h" *** ../gdb.dist/expprint.c Tue May 31 12:57:28 1988 --- expprint.c Wed Nov 9 02:03:12 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "symtab.h" #include "expression.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "symtab.h" #include "expression.h" *** ../gdb.dist/findvar.c Tue Jun 28 13:23:27 1988 --- findvar.c Wed Nov 9 02:03:06 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "initialize.h" #include "param.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "initialize.h" #include "param.h" *** ../gdb.dist/firstfile.c Fri Feb 12 10:24:25 1988 --- firstfile.c Wed Nov 9 02:03:03 1988 *************** *** 127,132 After the files to be found must come the file `lastfile' which ends the chain of calls. */ #include "initialize.h" static initialize_next_file (); --- 127,133 ----- After the files to be found must come the file `lastfile' which ends the chain of calls. */ + #include "config.h" #include "initialize.h" static initialize_next_file (); *** ../gdb.dist/gld-pinsn.c Wed Jun 22 13:14:01 1988 --- gld-pinsn.c Wed Nov 9 02:03:01 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include #include --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include #include *** ../gdb.dist/infcmd.c Tue Jun 28 13:26:13 1988 --- infcmd.c Wed Nov 9 02:02:59 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "initialize.h" #include "symtab.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "initialize.h" #include "symtab.h" *** ../gdb.dist/inflow.c Sun Sep 4 01:40:48 1988 --- inflow.c Thu Nov 10 14:58:45 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "initialize.h" #include "param.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "initialize.h" #include "param.h" *************** *** 26,31 #include #include #include #ifndef UMAX_PTRACE #include --- 27,36 ----- #include #include + #ifdef NS5 + #include + #include + #endif #include #ifndef UMAX_PTRACE #include *** ../gdb.dist/infrun.c Sat Jun 25 18:23:50 1988 --- infrun.c Wed Nov 9 02:02:54 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include "defs.h" #include "initialize.h" #include "param.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include "defs.h" #include "initialize.h" #include "param.h" *************** *** 29,34 #include #include #include #include #ifdef UMAX_PTRACE --- 30,41 ----- #include #include #include + #ifdef NS5 + #include + #ifndef X_OK + #define X_OK 01 + #endif + #endif #include #ifdef UMAX_PTRACE *** ../gdb.dist/kdb-start.c Wed Jul 16 10:25:52 1986 --- kdb-start.c Wed Nov 9 02:02:52 1988 *************** *** 1,3 #include "defs.h" #include "param.h" --- 1,4 ----- + #include "config.h" #include "defs.h" #include "param.h" *** ../gdb.dist/m68k-pinsn.c Wed Jun 22 13:14:41 1988 --- m68k-pinsn.c Wed Nov 9 02:02:50 1988 *************** *** 18,23 anyone else from sharing it farther. Help stamp out software hoarding! */ #include #include "defs.h" --- 18,24 ----- anyone else from sharing it farther. Help stamp out software hoarding! */ + #include "config.h" #include #include "defs.h" @//E*O*F patch#2// chmod u=rw,g=r,o=r patch#2 echo Inspecting for damage in transit... temp=/tmp/shar$$; dtemp=/tmp/.shar$$ trap "rm -f $temp $dtemp; exit" 0 1 2 3 15 cat > $temp <<\!!! 681 1995 15277 patch#2 !!! wc patch#2 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp if [ -s $dtemp ] then echo "Ouch [diff of wc output]:" ; cat $dtemp else echo "No problems found." fi exit 0