diff options
author | Stu Grossman <grossman@cygnus> | 1992-09-25 22:59:27 +0000 |
---|---|---|
committer | Stu Grossman <grossman@cygnus> | 1992-09-25 22:59:27 +0000 |
commit | 1aed676612501c4cc93bdb9c58dddcbde128636d (patch) | |
tree | cb5fe1f5aa91e57dc1fb45c2458fa9d36c86fbe4 /gdb | |
parent | b869d3f47fa723f7371f8ec9b62a45ff84bf68d2 (diff) | |
download | gdb-1aed676612501c4cc93bdb9c58dddcbde128636d.zip gdb-1aed676612501c4cc93bdb9c58dddcbde128636d.tar.gz gdb-1aed676612501c4cc93bdb9c58dddcbde128636d.tar.bz2 |
* tm-sparc.h, dbxread.c (read_ofile_symtab): Install Jim Wilson's
fix to differentiate between gcc1 & gcc2 compiled files so that we
can debug calls that pass structs as args correctly.
* symmisc.c (dump_symtab): If block was compiled with gcc, say
so, and what version.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/dbxread.c | 52 | ||||
-rw-r--r-- | gdb/tm-sparc.h | 8 |
3 files changed, 40 insertions, 26 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f6518b9..d21de67 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ Fri Sep 25 15:13:44 1992 Stu Grossman (grossman at cygnus.com) + * tm-sparc.h, dbxread.c (read_ofile_symtab): Install Jim Wilson's + fix to differentiate between gcc1 & gcc2 compiled files so that we + can debug calls that pass structs as args correctly. + * symmisc.c (dump_symtab): If block was compiled with gcc, say + so, and what version. + * remote.c (remote_wait): Make regs be char to avoid picayune ANSI compiler warnings. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index b97e50c..c14d865 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1468,10 +1468,14 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size, SET_NAMESTRING (); - processing_gcc_compilation = - (bufp->n_type == N_TEXT - && (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0 - || strcmp(namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0)); + processing_gcc_compilation = 0; + if (bufp->n_type == N_TEXT) + { + if (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0) + processing_gcc_compilation = 1; + else if (strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0) + processing_gcc_compilation = 2; + } /* Try to select a C++ demangling based on the compilation unit producer. */ @@ -1479,7 +1483,7 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size, if (processing_gcc_compilation) { #if 1 /* Works, but is experimental. -fnf */ - if (current_demangling_style == auto_demangling) + if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } @@ -1523,18 +1527,22 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size, } /* We skip checking for a new .o or -l file; that should never happen in this routine. */ - else if (type == N_TEXT - && (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0 - || strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0)) + else if (type == N_TEXT) { /* I don't think this code will ever be executed, because the GCC_COMPILED_FLAG_SYMBOL usually is right before the N_SO symbol which starts this source file. However, there is no reason not to accept the GCC_COMPILED_FLAG_SYMBOL anywhere. */ - processing_gcc_compilation = 1; + + processing_gcc_compilation = 0; + if (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0) + processing_gcc_compilation = 1; + else if (strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0) + processing_gcc_compilation = 2; + #if 1 /* Works, but is experimental. -fnf */ - if (current_demangling_style == auto_demangling) + if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } @@ -1958,11 +1966,11 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) case N_OPT: /* Solaris 2: Compiler options */ if (name) { - if (!strcmp (name, GCC2_COMPILED_FLAG_SYMBOL)) + if (strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0) { - processing_gcc_compilation = 1; + processing_gcc_compilation = 2; #if 1 /* Works, but is experimental. -fnf */ - if (current_demangling_style == auto_demangling) + if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } @@ -2045,16 +2053,16 @@ copy_pending (beg, begi, end) adjusted for elf details. */ void -DEFUN(elfstab_build_psymtabs, (objfile, section_offsets, mainline, +elfstab_build_psymtabs (objfile, section_offsets, mainline, staboffset, stabsize, - stabstroffset, stabstrsize), - struct objfile *objfile AND - struct section_offsets *section_offsets AND - int mainline AND - unsigned int staboffset AND - unsigned int stabsize AND - unsigned int stabstroffset AND - unsigned int stabstrsize) + stabstroffset, stabstrsize) + struct objfile *objfile; + struct section_offsets *section_offsets; + int mainline; + unsigned int staboffset; + unsigned int stabsize; + unsigned int stabstroffset; + unsigned int stabstrsize; { int val; bfd *sym_bfd = objfile->obfd; diff --git a/gdb/tm-sparc.h b/gdb/tm-sparc.h index 8e06165..25fc6d3 100644 --- a/gdb/tm-sparc.h +++ b/gdb/tm-sparc.h @@ -30,13 +30,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ (a lie, and a serious one since we don't know which register to use), and a LOC_REGISTER saying that the struct is in a register (sort of a lie, but fixable with REG_STRUCT_HAS_ADDR). Gcc version - two (as of 1.92) behaves like sun cc, but I don't know how we can - distinguish between gcc version 1 and gcc version 2. + two (as of 1.92) behaves like sun cc. REG_STRUCT_HAS_ADDR is smart + enough to distinguish between Sun cc, gcc version 1 and gcc version 2. This still doesn't work if the argument is not one passed in a register (i.e. it's the 7th or later argument). */ -#define REG_STRUCT_HAS_ADDR(gcc_p) (!(gcc_p)) -#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (!(gcc_p)) +#define REG_STRUCT_HAS_ADDR(gcc_p) (gcc_p != 1) +#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (gcc_p != 1) /* If Pcc says that a parameter is a short, it's a short. This is because the parameter does get passed in in a register as an int, |