diff options
author | John Gilmore <gnu@cygnus> | 1991-05-02 03:39:15 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-05-02 03:39:15 +0000 |
commit | 639893384d5faeaa671f98dfc3ed169e9aa2ccc9 (patch) | |
tree | 40f7a4988d62134fc87b4150350a47248d3169a2 /gdb/coffread.c | |
parent | e77463a15c9c8cdb06a47cf3f84bac76eddd1f25 (diff) | |
download | gdb-639893384d5faeaa671f98dfc3ed169e9aa2ccc9.zip gdb-639893384d5faeaa671f98dfc3ed169e9aa2ccc9.tar.gz gdb-639893384d5faeaa671f98dfc3ed169e9aa2ccc9.tar.bz2 |
Merge devo/bfd with GDB's bfd.
Get getopt and obstack from -liberty rather than compiling them here.
* coffread.c: turn a printf into a complain(), and try to deal more
gracefully with botched-looking lineno pointers.
* dbxread.c: Use bfd_get_symcount rather than bfd_get_symcount_upper_bound.
Don't coredump on files with zero symbols in them (a BFD bug showed this one).
* environ.c: Pass GNUTARGET into the parent (gdb) as well as the child.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 3dcb2d1..0472591 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -26,13 +26,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symtab.h" #include "breakpoint.h" #include "bfd.h" -#include "libcoff.h" /* FIXME secret internal data from BFD */ #include "symfile.h" #include <intel-coff.h> #include <obstack.h> #include <string.h> +#include "libcoff.h" /* FIXME secret internal data from BFD */ + static void add_symbol_to_list (); static void read_coff_symtab (); static void patch_opaque_types (); @@ -201,6 +202,9 @@ extern CORE_ADDR startup_file_end; /* From blockframe.c */ struct complaint ef_complaint = {"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0}; +struct complaint lineno_complaint = + {"Line number pointer %d lower than start of line numbers", 0, 0}; + /* Look up a coff type-number index. Return the address of the slot where the type for that index is stored. @@ -1315,8 +1319,10 @@ enter_linenos (file_offset, first_line, last_line) if (file_offset < linetab_offset) { - fprintf (stderr, "\nInvalid symbol file: file_offset < linetab_offset."); - return; + complain (lineno_complaint, file_offset); + if (file_offset > linetab_size) /* Too big to be an offset? */ + return; + file_offset += linetab_offset; /* Try reading at that linetab offset */ } rawptr = &linetab[file_offset - linetab_offset]; @@ -1327,7 +1333,7 @@ enter_linenos (file_offset, first_line, last_line) first_line--; /* Bcopy since occaisionally rawptr isn't pointing at long - boundaries. FIXME we need to byteswap here!!! */ + boundaries. */ for (bcopy (rawptr, &lptr, LINESZ); L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line; rawptr += LINESZ, bcopy (rawptr, &lptr, LINESZ)) |