Add support to readelf to decode and display the contents of .debug_ranges

sections.
This commit is contained in:
Nick Clifton 2004-11-03 10:44:45 +00:00
parent 57346661b5
commit 18bd398bc4
4 changed files with 603 additions and 232 deletions

View File

@ -1,3 +1,64 @@
2004-11-03 Nick Clifton <nickc@redhat.com>
* readelf.c (do_debug_ranges): New variable.
(usage): Document new switch: -wR or --debug-dump=Ranges.
(parse_args): Handle new switch. Replace switch statement for the
long options with a more compact table structure.
(process_section_headers): Allow the dumping of .debug_ranges
sections if so requested.
(debug_displays): Likewise.
(load_debug_range): New function: Grabs the contents of a
.debug_ranges section.
(free_debug_range): New function: Releases the grabbed
.debug_ranges section.
(decode_64bit_range): New function: Displays a 64-bit range in a
.debug_ranges section.
(decode_range): New function: Displays a 32-bit range in a
.debug_ranges section.
(read_and_display_attr_value): Record the value of DW_AT_low_pc
attributes. Use decode_ranges() to display a DW_AT_ranges
attribute.
(display_debug_info): Use load_debug_range() and
free_debug_range().
(display_64bit_debug_ranges): New function. Displays the contents
of a 64-bit format .debug_ranges section.
(display_debug_ranges): New function: Displays the contents of a
32-bit .debug_ranges section.
(main): Move cmdline_dump_sects and num_cmdline_dump_sects into the
global scope.
(process_object): Initialise the dump_sects array from the
cmdline_dump_sects array before processing each object file.
(streq, strneq): New macros. Use them to replace occurrences of
strcmp() and strncmp().
(debug_information): New structure array to replace
debug_line_pointer_sizes array.
(num_debug_info_entries): New variable to replace
num_debug_line_pointers.
(get_pointer_size_of_comp_unit): New function: Returns the pointer
size of a given compilation unit.
(get_debug_info): New function to replace
get_debug_line_pointer_sizes.
(display_debug_lines): Use the new functions.
(display_debug_loc): Likewise.
(disassemble_section): Change return type to int.
(display_debug_lines): Move local variables to their
innermost scope.
(display_debug_section): Likewise. Also record the return value
of functions called and pass this back to the parent. Also only
warn about undumped sections when the user explicitly requested
their dumping.
(debug_apply_rela_addends): Allow relocations against STT_OBJECT
types as well.
* NEWS: Mention the support for decoding .debug_ranges sections.
* doc/binutils.texi: Document the new command line switch to
readelf.
2004-11-03 Randolph Chung <tausq@debian.org>
* readelf.c (ia64_unw_aux_info, ia64_unw_table_entry): Rename from

View File

@ -1,5 +1,10 @@
-*- text -*-
* readelf can now display address ranges from .debug_range sections. This
happens automatically when a DW_AT_range attribute is encountered. The
command line switch --debug-dump=Ranges (or -wR) can also be used to display
the contents of the .debug_range section.
* nm and objdump now have a switch "--special-syms" to enable the displaying of
symbols which the target considers to be special. By default these symbols
are no longer displayed. Currently the only special symbols are the Mapping

View File

@ -3153,8 +3153,8 @@ readelf [@option{-a}|@option{--all}]
[@option{-A}|@option{--arch-specific}]
[@option{-D}|@option{--use-dynamic}]
[@option{-x} <number>|@option{--hex-dump=}<number>]
[@option{-w[liaprmfFso]}|
@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc]]
[@option{-w[liaprmfFsoR]}|
@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
[@option{-I}|@option{-histogram}]
[@option{-v}|@option{--version}]
[@option{-W}|@option{--wide}]
@ -3271,8 +3271,8 @@ symbols section.
@itemx --hex-dump=<number>
Displays the contents of the indicated section as a hexadecimal dump.
@item -w[liaprmfFso]
@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc]
@item -w[liaprmfFsoR]
@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]
Displays the contents of the debug sections in the file, if any are
present. If one of the optional letters or words follows the switch
then only data found in those specific sections will be dumped.

File diff suppressed because it is too large Load Diff