From 33e80786374aa4de613e8c2a9d3002d9704fb037 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 27 Mar 2014 12:03:34 -0700 Subject: [PATCH] * dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments. Remove argument abbrev_section. All callers updated. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 22 ++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e5b16bc..67bb4be 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-03-27 Doug Evans + * dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments. + Remove argument abbrev_section. All callers updated. + +2014-03-27 Doug Evans + * dwarf2read.c (struct dwarf2_cu): Improve comments for members addr_base, ranges_base. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index cf95583..5238f4b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -5515,10 +5515,9 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, do_cleanups (cleanups); } -/* Read CU/TU THIS_CU in section SECTION, - but do not follow DW_AT_GNU_dwo_name if present. - DWOP_FILE, if non-NULL, is the DWO/DWP file to read (the caller is assumed - to have already done the lookup to find the DWO/DWP file). +/* Read CU/TU THIS_CU but do not follow DW_AT_GNU_dwo_name if present. + DWO_FILE, if non-NULL, is the DWO file to read (the caller is assumed + to have already done the lookup to find the DWO file). The caller is required to fill in THIS_CU->section, THIS_CU->offset, and THIS_CU->is_debug_types, but nothing else. @@ -5534,7 +5533,6 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, static void init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, - struct dwarf2_section_info *abbrev_section, struct dwo_file *dwo_file, die_reader_func_ftype *die_reader_func, void *data) @@ -5542,6 +5540,7 @@ init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile = dwarf2_per_objfile->objfile; struct dwarf2_section_info *section = this_cu->section; bfd *abfd = get_section_bfd_owner (section); + struct dwarf2_section_info *abbrev_section; struct dwarf2_cu cu; const gdb_byte *begin_info_ptr, *info_ptr; struct die_reader_specs reader; @@ -5556,6 +5555,10 @@ init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, gdb_assert (this_cu->cu == NULL); + abbrev_section = (dwo_file != NULL + ? &dwo_file->sections.abbrev + : get_abbrev_section_for_cu (this_cu)); + /* This is cheap if the section is already read in. */ dwarf2_read_section (objfile, section); @@ -5603,10 +5606,7 @@ init_cutu_and_read_dies_simple (struct dwarf2_per_cu_data *this_cu, die_reader_func_ftype *die_reader_func, void *data) { - init_cutu_and_read_dies_no_follow (this_cu, - get_abbrev_section_for_cu (this_cu), - NULL, - die_reader_func, data); + init_cutu_and_read_dies_no_follow (this_cu, NULL, die_reader_func, data); } /* Type Unit Groups. @@ -9326,9 +9326,7 @@ create_dwo_cu (struct dwo_file *dwo_file) per_cu.offset.sect_off = info_ptr - section->buffer; per_cu.section = section; - init_cutu_and_read_dies_no_follow (&per_cu, - &dwo_file->sections.abbrev, - dwo_file, + init_cutu_and_read_dies_no_follow (&per_cu, dwo_file, create_dwo_cu_reader, &create_dwo_cu_data); -- 2.7.4