diff options
author | Nick Clifton <nickc@redhat.com> | 2008-01-14 12:26:57 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2008-01-14 12:26:57 +0000 |
commit | 1febe64d9616c501f59099727efb718273259859 (patch) | |
tree | 85ee01b2f56c6bd72ab8a71386556c7b1870f40e | |
parent | c1766e7d3e9e7f44ce28689e518c02e2a86f5adb (diff) | |
download | gdb-1febe64d9616c501f59099727efb718273259859.zip gdb-1febe64d9616c501f59099727efb718273259859.tar.gz gdb-1febe64d9616c501f59099727efb718273259859.tar.bz2 |
* dwarf.c (process_debug_info): Include the CU offset and corrupt
version value when reporting unrecognised DWARF version numbers.
(load_debug_info): Remember a failed attempt to load and parse the
.debug_info section and do not repeat such attempts.
(display_debug_lines): Check the return value from load_debug_info
and return whilst displaying a warning message if the load failed.
(display_debug_loc): Likewise.
(display_debug_ranges): Likewise.
-rw-r--r-- | binutils/ChangeLog | 11 | ||||
-rw-r--r-- | binutils/dwarf.c | 34 |
2 files changed, 39 insertions, 6 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index c74bc0f..94330de 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,14 @@ +2008-01-14 Nick Clifton <nickc@redhat.com> + + * dwarf.c (process_debug_info): Include the CU offset and corrupt + version value when reporting unrecognised DWARF version numbers. + (load_debug_info): Remember a failed attempt to load and parse the + .debug_info section and do not repeat such attempts. + (display_debug_lines): Check the return value from load_debug_info + and return whilst displaying a warning message if the load failed. + (display_debug_loc): Likewise. + (display_debug_ranges): Likewise. + 2008-01-10 Andreas Schwab <schwab@suse.de> * readelf.c (is_64bit_abs_reloc): Handle R_S390_64. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 093832d..bac80bc 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -1841,7 +1841,8 @@ process_debug_info (struct dwarf_section *section, void *file, if (compunit.cu_version != 2 && compunit.cu_version != 3) { - warn (_("Only version 2 and 3 DWARF debug information is currently supported.\n")); + warn (_("CU at offset %lx contains corrupt or unsupported version number: %d.\n"), + cu_offset, compunit.cu_version); continue; } @@ -1985,6 +1986,11 @@ load_debug_info (void * file) last_pointer_size = 0; warned_about_missing_comp_units = FALSE; + /* If we have already tried and failed to load the .debug_info + section then do not bother to repear the task. */ + if (num_debug_info_entries == (unsigned) -1) + return 0; + /* If we already have the information there is nothing else to do. */ if (num_debug_info_entries > 0) return num_debug_info_entries; @@ -1992,8 +1998,9 @@ load_debug_info (void * file) if (load_debug_section (info, file) && process_debug_info (&debug_displays [info].section, file, 1)) return num_debug_info_entries; - else - return 0; + + num_debug_info_entries = (unsigned) -1; + return 0; } static int @@ -2006,7 +2013,12 @@ display_debug_lines (struct dwarf_section *section, void *file) printf (_("\nDump of debug contents of section %s:\n\n"), section->name); - load_debug_info (file); + if (load_debug_info (file) == 0) + { + warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"), + section->name); + return 0; + } while (data < end) { @@ -2501,7 +2513,12 @@ display_debug_loc (struct dwarf_section *section, void *file) return 0; } - load_debug_info (file); + if (load_debug_info (file) == 0) + { + warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"), + section->name); + return 0; + } /* Check the order of location list in .debug_info section. If offsets of location lists are in the ascending order, we can @@ -2876,7 +2893,12 @@ display_debug_ranges (struct dwarf_section *section, return 0; } - load_debug_info (file); + if (load_debug_info (file) == 0) + { + warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"), + section->name); + return 0; + } /* Check the order of range list in .debug_info section. If offsets of range lists are in the ascending order, we can |