diff options
author | Alan Modra <amodra@gmail.com> | 2025-02-19 22:55:43 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2025-02-19 23:11:23 +1030 |
commit | cb1861cb8ff5433c972f7d2894206e30bd50f696 (patch) | |
tree | 9b9c538abd92cb1e88a4a6f0148985fb0e4909c8 /binutils | |
parent | e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4 (diff) | |
download | binutils-cb1861cb8ff5433c972f7d2894206e30bd50f696.zip binutils-cb1861cb8ff5433c972f7d2894206e30bd50f696.tar.gz binutils-cb1861cb8ff5433c972f7d2894206e30bd50f696.tar.bz2 |
bintuils/dwarf.c indentation fixes
plus a few other formatting fixes.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/dwarf.c | 121 |
1 files changed, 59 insertions, 62 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index bfbf83e..fcf32ec 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -489,7 +489,7 @@ process_extended_line_op (unsigned char * data, printf (_("set Discriminator to %" PRIu64 "\n"), val); break; - /* HP extensions. */ + /* HP extensions. */ case DW_LNE_HP_negate_is_UV_update: printf ("DW_LNE_HP_negate_is_UV_update\n"); break; @@ -753,7 +753,7 @@ fetch_indexed_offset (uint64_t idx, offset_of_offset, section->name); return -1; } - + return base_address + byte_get (section->start + offset_of_offset, offset_size); } @@ -1053,7 +1053,7 @@ find_and_process_abbrev_set (struct dwarf_section *section, /* PR 17531: file:4bcd9ce9. */ warn (_("Debug info is corrupted, abbrev size (%#" PRIx64 ")" " is larger than abbrev section size (%#" PRIx64 ")\n"), - abbrev_base + abbrev_size, section->size); + abbrev_base + abbrev_size, section->size); return NULL; } if (abbrev_offset >= abbrev_size) @@ -1577,8 +1577,8 @@ decode_location_expression (unsigned char * data, /* PR 17531: file: 0cc9cd00. */ if (uvalue > (size_t) (end - data)) uvalue = end - data; - printf ("%s: (", (op == DW_OP_entry_value ? "DW_OP_entry_value" - : "DW_OP_GNU_entry_value")); + printf ("%s: (", (op == DW_OP_entry_value + ? "DW_OP_entry_value" : "DW_OP_GNU_entry_value")); if (decode_location_expression (data, pointer_size, offset_size, dwarf_version, uvalue, cu_offset, section)) @@ -1590,8 +1590,8 @@ decode_location_expression (unsigned char * data, case DW_OP_GNU_const_type: READ_ULEB (uvalue, data, end); printf ("%s: <%#" PRIx64 "> ", - (op == DW_OP_const_type ? "DW_OP_const_type" - : "DW_OP_GNU_const_type"), + (op == DW_OP_const_type + ? "DW_OP_const_type" : "DW_OP_GNU_const_type"), cu_offset + uvalue); SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); data = display_block (data, uvalue, end, ' '); @@ -1600,8 +1600,8 @@ decode_location_expression (unsigned char * data, case DW_OP_GNU_regval_type: READ_ULEB (uvalue, data, end); printf ("%s: %" PRIu64 " (%s)", - (op == DW_OP_regval_type ? "DW_OP_regval_type" - : "DW_OP_GNU_regval_type"), + (op == DW_OP_regval_type + ? "DW_OP_regval_type" : "DW_OP_GNU_regval_type"), uvalue, regname (uvalue, 1)); READ_ULEB (uvalue, data, end); printf (" <%#" PRIx64 ">", cu_offset + uvalue); @@ -1610,8 +1610,8 @@ decode_location_expression (unsigned char * data, case DW_OP_GNU_deref_type: SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); printf ("%s: %" PRId64, - (op == DW_OP_deref_type ? "DW_OP_deref_type" - : "DW_OP_GNU_deref_type"), + (op == DW_OP_deref_type + ? "DW_OP_deref_type" : "DW_OP_GNU_deref_type"), uvalue); READ_ULEB (uvalue, data, end); printf (" <%#" PRIx64 ">", cu_offset + uvalue); @@ -1627,8 +1627,8 @@ decode_location_expression (unsigned char * data, case DW_OP_GNU_reinterpret: READ_ULEB (uvalue, data, end); printf ("%s <%#" PRIx64 ">", - (op == DW_OP_reinterpret ? "DW_OP_reinterpret" - : "DW_OP_GNU_reinterpret"), + (op == DW_OP_reinterpret + ? "DW_OP_reinterpret" : "DW_OP_GNU_reinterpret"), uvalue ? cu_offset + uvalue : uvalue); break; case DW_OP_GNU_parameter_ref: @@ -3617,17 +3617,17 @@ skip_attribute (unsigned long form, case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_strx1: - case DW_FORM_addrx1: + case DW_FORM_addrx1: inc = 1; break; case DW_FORM_ref2: case DW_FORM_data2: case DW_FORM_strx2: - case DW_FORM_addrx2: + case DW_FORM_addrx2: inc = 2; break; case DW_FORM_strx3: - case DW_FORM_addrx3: + case DW_FORM_addrx3: inc = 3; break; case DW_FORM_ref_sup4: @@ -3643,7 +3643,7 @@ skip_attribute (unsigned long form, case DW_FORM_ref_sig8: inc = 8; break; - case DW_FORM_data16: + case DW_FORM_data16: inc = 16; break; case DW_FORM_sdata: @@ -4240,15 +4240,15 @@ process_debug_info (struct dwarf_section * section, break; case DW_TAG_subprogram: need_base_address = 0; - if (level <= frame_base_level) - /* Don't reset that for nested subprogram. */ - have_frame_base = 0; + if (level <= frame_base_level) + /* Don't reset that for nested subprogram. */ + have_frame_base = 0; break; } - debug_info *debug_info_p = - (debug_information && unit < alloc_num_debug_info_entries) - ? debug_information + unit : NULL; + debug_info *debug_info_p = ((debug_information + && unit < alloc_num_debug_info_entries) + ? debug_information + unit : NULL); assert (!debug_info_p || (debug_info_p->num_loc_offsets @@ -4330,7 +4330,7 @@ process_debug_info (struct dwarf_section * section, default: assert (0); - } + } if (entry->children) ++level; @@ -7414,8 +7414,7 @@ display_debug_loc (struct dwarf_section *section, void *file) for (; j < num; j++) { - if (last_offset > - debug_information [i].loc_offsets [j] + if (last_offset > debug_information [i].loc_offsets [j] || (last_offset == debug_information [i].loc_offsets [j] && last_view > debug_information [i].loc_views [j])) { @@ -7448,9 +7447,8 @@ display_debug_loc (struct dwarf_section *section, void *file) uint64_t base_address; unsigned int k; int has_frame_base; - debug_info *debug_info_p = debug_information + i; - uint32_t offset_count; - + debug_info *debug_info_p = debug_information + i; + uint32_t offset_count; if (!locs_sorted) { @@ -7501,10 +7499,10 @@ display_debug_loc (struct dwarf_section *section, void *file) j = locs_sorted ? k : array[k]; if (k && (debug_info_p->loc_offsets [locs_sorted - ? k - 1 : array [k - 1]] + ? k - 1 : array [k - 1]] == debug_info_p->loc_offsets [j]) && (debug_info_p->loc_views [locs_sorted - ? k - 1 : array [k - 1]] + ? k - 1 : array [k - 1]] == debug_info_p->loc_views [j])) continue; has_frame_base = debug_info_p->have_frame_base [j]; @@ -8368,7 +8366,7 @@ display_debug_ranges (struct dwarf_section *section, } introduce (section, false); - + if (load_debug_info (file) == 0) { warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"), @@ -8458,7 +8456,7 @@ display_debug_ranges (struct dwarf_section *section, } next = section_begin + offset; /* Offset is from the section start, the base has already been added. */ - + /* If multiple DWARF entities reference the same range then we will have multiple entries in the `range_entries' list for the same offset. Thanks to the sort above these will all be consecutive in @@ -9268,7 +9266,7 @@ decode_eh_encoding (unsigned int value) Upon success, returns the read value and sets * RETURN_LEN to the number of bytes read. Upon failure returns zero and sets * RETURN_LEN to 0. - + Note: does not perform any application transformations to the value. */ static uint64_t @@ -9342,7 +9340,6 @@ get_encoded_eh_value (unsigned int encoding, fail: * return_len = 0; return 0; - } static uint64_t @@ -9415,7 +9412,7 @@ display_eh_frame_hdr (struct dwarf_section *section, uint64_t offset_eh_frame_ptr = encoded_eh_offset (ptr_enc, section, 4, eh_frame_ptr); if (offset_eh_frame_ptr != eh_frame_ptr) printf (_(" (offset: %#" PRIx64 ")"), offset_eh_frame_ptr); - + printf ("\n"); start += len; @@ -9430,7 +9427,7 @@ display_eh_frame_hdr (struct dwarf_section *section, warn (_("The count field format should be absolute, not relative to an address\n")); return 0; } - + uint64_t fde_count = get_encoded_eh_value (count_enc, start, end, & len); if (len == 0) { @@ -9522,7 +9519,7 @@ display_debug_frames (struct dwarf_section *section, if (length == 0) { printf ("\n%08tx ZERO terminator\n\n", - saved_start - section_start); + saved_start - section_start); /* Skip any zero terminators that directly follow. A corrupt section size could have loaded a whole slew of zero filled memory bytes. eg @@ -11013,7 +11010,7 @@ display_gdb_index (struct dwarf_section *section, if (version < 6) warn (_("Version 5 does not include inlined functions.\n")); if (version < 7) - warn (_("Version 6 does not include symbol attributes.\n")); + warn (_("Version 6 does not include symbol attributes.\n")); /* Version 7 indices generated by Gold have bad type unit references, PR binutils/15021. But we don't know if the index was generated by Gold or not, so to avoid worrying users with gdb-generated indices @@ -11246,24 +11243,24 @@ get_DW_SECT_short_name (unsigned int dw_sect) switch (dw_sect) { - case DW_SECT_INFO: - return "info"; - case DW_SECT_TYPES: - return "types"; - case DW_SECT_ABBREV: - return "abbrev"; - case DW_SECT_LINE: - return "line"; - case DW_SECT_LOC: - return "loc"; - case DW_SECT_STR_OFFSETS: - return "str_off"; - case DW_SECT_MACINFO: - return "macinfo"; - case DW_SECT_MACRO: - return "macro"; - default: - break; + case DW_SECT_INFO: + return "info"; + case DW_SECT_TYPES: + return "types"; + case DW_SECT_ABBREV: + return "abbrev"; + case DW_SECT_LINE: + return "line"; + case DW_SECT_LOC: + return "loc"; + case DW_SECT_STR_OFFSETS: + return "str_off"; + case DW_SECT_MACINFO: + return "macinfo"; + case DW_SECT_MACRO: + return "macro"; + default: + break; } snprintf (buf, sizeof (buf), "%d", dw_sect); @@ -11425,7 +11422,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) { printf (_(" Offset table\n")); printf (" slot %-16s ", - is_tu_index ? _("signature") : _("dwo_id")); + is_tu_index ? _("signature") : _("dwo_id")); } else { @@ -11512,7 +11509,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) printf ("\n"); printf (_(" Size table\n")); printf (" slot %-16s ", - is_tu_index ? _("signature") : _("dwo_id")); + is_tu_index ? _("signature") : _("dwo_id")); } for (j = 0; j < ncols; j++) @@ -11565,7 +11562,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) if (dw_sect >= DW_SECT_MAX) warn (_("Overlarge Dwarf section index detected: %u\n"), dw_sect); else - this_set [row - 1].section_sizes [dw_sect] = val; + this_set [row - 1].section_sizes [dw_sect] = val; } } @@ -11581,7 +11578,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) printf (_(" Unsupported version (%d)\n"), version); if (do_display) - printf ("\n"); + printf ("\n"); return true; } @@ -11651,7 +11648,7 @@ display_debug_not_supported (struct dwarf_section *section, void *file ATTRIBUTE_UNUSED) { printf (_("Displaying the debug contents of section %s is not yet supported.\n"), - section->name); + section->name); return 1; } |