From 6e11079fc74fb9ad24c02a57ae9310aa08c36461 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Fri, 11 May 2012 18:18:33 +0000 Subject: * doc/binutils.texi: Add --dwarf-check option. * dwarf.c (dwarf_check): New global flag. (fetch_indexed_string): New function. (fetch_indexed_value): New function. (get_FORM_name): Add DW_FORM_GNU_str_index and DW_FORM_GNU_addr_index. (decode_location_expression): Add DW_OP_GNU_addr_index. (read_and_display_attr_value): Add DW_FORM_GNU_str_index, DW_FORM_GNU_addr_index, DW_AT_GNU_addr_base, and DW_AT_GNU_ranges_base. (get_AT_name): Add new attributes for Fission. (process_debug_info): Load new debug sections for Fission. (load_debug_info): Check for .debug_info.dwo section. (display_loc_list, display_loc_list_dwo): New functions. (display_debug_loc): Move logic to above two functions. (display_debug_info): Choose abbrev section based on info section. (display_debug_types): Likewise. (display_trace_info): Likewise. (comp_addr_base): New function. (display_debug_addr): New function. (display_debug_str_offsets): New function. (display_debug_ranges): Allow missing range lists. Suppress diagnostics if dwarf_check not set. (debug_displays): Add column to select abbrev section. * dwarf.h (enum dwarf_section_display_enum): Add new debug sections for Fission. (struct dwarf_section): Add abbrev_sec field. (struct dwarf_section_display): New type. (debug_info): Add addr_base, ranges_base fields. (dwarf_check): New global variable. * objdump.c (usage): Add --dwarf-check option. (enum option_values): Add OPTION_DWARF_CHECK. (long_options): Add --dwarf-check. (main): Likewise. * readelf.c (OPTION_DWARF_CHECK): New macro. (options): Add --dwarf-check. (parse_args): Likewise. (process_section_headers): Use const_strneq instead of streq. --- binutils/objdump.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'binutils/objdump.c') diff --git a/binutils/objdump.c b/binutils/objdump.c index 02f312d70e..0cad73b32c 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -261,7 +261,9 @@ usage (FILE *stream, int status) fprintf (stream, _("\ --dwarf-depth=N Do not display DIEs at depth N or greater\n\ --dwarf-start=N Display DIEs starting with N, at the same depth\n\ - or deeper\n\n")); + or deeper\n\ + --dwarf-check Make additional dwarf internal consistency checks.\ + \n\n")); list_supported_targets (program_name, stream); list_supported_architectures (program_name, stream); @@ -292,6 +294,7 @@ enum option_values OPTION_INSN_WIDTH, OPTION_ADJUST_VMA, OPTION_DWARF_DEPTH, + OPTION_DWARF_CHECK, OPTION_DWARF_START }; @@ -343,6 +346,7 @@ static struct option long_options[]= {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, + {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, {0, no_argument, 0, 0} }; @@ -3587,6 +3591,9 @@ main (int argc, char **argv) suppress_bfd_header = 1; } break; + case OPTION_DWARF_CHECK: + dwarf_check = TRUE; + break; case 'G': dump_stab_section_info = TRUE; seenflag = TRUE; -- cgit v1.2.1