Skip to content

Commit 2da8530

Browse files
committed
Merge branch 'cleanup' of https://github.com/oltolm/libdwarf-code into oltolm-cleanup
Removing unused fields from CU struct.
2 parents 569fa9b + cd92794 commit 2da8530

4 files changed

Lines changed: 3 additions & 19 deletions

File tree

src/lib/libdwarf/dwarf_die_deliv.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,10 +1503,7 @@ find_cu_die_base_fields(Dwarf_Debug dbg,
15031503
&at_ranges_offset,
15041504
&is_info,
15051505
error);
1506-
if (res == DW_DLV_OK) {
1507-
cucon->cc_at_ranges_offset = at_ranges_offset;
1508-
cucon->cc_at_ranges_offset_present = TRUE;
1509-
} else {
1506+
if (res != DW_DLV_OK) {
15101507
local_attrlist_dealloc(dbg,atcount,alist);
15111508
return res;
15121509
}

src/lib/libdwarf/dwarf_opaque.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ struct Dwarf_CU_Context_s {
285285
/* cc_cu_die_offset_present is non-zero if
286286
cc_cu_die_global_sec_offset is meaningful. */
287287
Dwarf_Bool cc_cu_die_offset_present;
288-
Dwarf_Bool cc_at_ranges_offset_present;
289288
/* About: DW_AT_addr_base in CU DIE,
290289
offset to .debug_addr table */
291290
Dwarf_Bool cc_addr_base_offset_present;
@@ -361,8 +360,6 @@ struct Dwarf_CU_Context_s {
361360
Dwarf_Bool cc_macro_base_present;
362361
Dwarf_Bool cc_macro_header_length_present;
363362

364-
/* For quick access to .debug_ranges from a CU DIE. */
365-
Dwarf_Unsigned cc_at_ranges_offset;
366363
/* DW_SECT_RNGLISTS */
367364
/* DW_AT_GNU_ranges_base was a GNU extension that appeared
368365
but was unused. See dwarf_die_deliv.c for details. */

src/lib/libdwarf/dwarf_ranges.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ dwarf_get_ranges_baseaddress(Dwarf_Debug dw_dbg,
444444
Dwarf_Error *dw_error)
445445
{
446446
Dwarf_CU_Context context = 0;
447-
Dwarf_Unsigned local_ranges_offset = 0;
448-
Dwarf_Bool local_ranges_offset_present = FALSE;
449447
Dwarf_Bool have_die_ranges_offset = FALSE;
450448
Dwarf_Unsigned die_ranges_offset = 0;
451449
Dwarf_Bool have_die_base_addr = FALSE;
@@ -484,16 +482,11 @@ dwarf_get_ranges_baseaddress(Dwarf_Debug dw_dbg,
484482
"dwarf_get_ranges_baseaddress");
485483
return DW_DLV_ERROR;
486484
}
487-
if (have_die_ranges_offset) {
488-
/* From dw_die */
489-
local_ranges_offset_present = have_die_ranges_offset;
490-
local_ranges_offset = die_ranges_offset;
491-
}
492485
if (dw_at_ranges_offset) {
493-
*dw_at_ranges_offset = local_ranges_offset;
486+
*dw_at_ranges_offset = die_ranges_offset;
494487
}
495488
if (dw_at_ranges_offset_present) {
496-
*dw_at_ranges_offset_present = local_ranges_offset_present;
489+
*dw_at_ranges_offset_present = have_die_ranges_offset;
497490
}
498491
if (context->cc_base_address_present) {
499492
*dw_baseaddress = context->cc_base_address;

src/lib/libdwarf/dwarf_util.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ _dwarf_dump_optional_fields(const char *msg,
189189
/* useful? */
190190
printf(" cc_cu_die_offset_present...: %d \n",
191191
context->cc_cu_die_offset_present);
192-
printf(" cc_at_ranges_offset_present: %d 0x%lx\n",
193-
context->cc_at_ranges_offset_present,
194-
(unsigned long)context->cc_at_ranges_offset);
195192
printf(" cc_addr_base_offset_present: %d 0x%lx\n",
196193
context->cc_addr_base_offset_present,
197194
(unsigned long)context->cc_addr_base_offset);

0 commit comments

Comments
 (0)