This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] dwarf2read.c (per_cu_header_read_in): Simplify
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Wed, 27 Jun 2012 07:27:49 -0700 (PDT)
- Subject: [commit] dwarf2read.c (per_cu_header_read_in): Simplify
Hi.
fyi, committed.
Regression tested on amd64-linux.
2012-06-27 Doug Evans <dje@google.com>
* dwarf2read.c (per_cu_header_read_in): Simplify, and handle
type units.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.669
diff -u -p -r1.669 dwarf2read.c
--- dwarf2read.c 26 Jun 2012 21:56:46 -0000 1.669
+++ dwarf2read.c 27 Jun 2012 14:19:58 -0000
@@ -16796,19 +16796,15 @@ static const struct comp_unit_head *
per_cu_header_read_in (struct comp_unit_head *cu_headerp,
struct dwarf2_per_cu_data *per_cu)
{
- struct objfile *objfile;
- struct dwarf2_per_objfile *per_objfile;
gdb_byte *info_ptr;
if (per_cu->cu)
return &per_cu->cu->header;
- objfile = per_cu->objfile;
- per_objfile = objfile_data (objfile, dwarf2_objfile_data_key);
- info_ptr = per_objfile->info.buffer + per_cu->offset.sect_off;
+ info_ptr = per_cu->info_or_types_section->buffer + per_cu->offset.sect_off;
memset (cu_headerp, 0, sizeof (*cu_headerp));
- read_comp_unit_head (cu_headerp, info_ptr, objfile->obfd);
+ read_comp_unit_head (cu_headerp, info_ptr, per_cu->objfile->obfd);
return cu_headerp;
}