From 639893384d5faeaa671f98dfc3ed169e9aa2ccc9 Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Thu, 2 May 1991 03:39:15 +0000 Subject: 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. --- gdb/coffread.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gdb/coffread.c') 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 #include #include +#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)) -- cgit v1.1