This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Remove unnecessary reading of dwarf2 abbrev table
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Thu, 1 Mar 2012 17:56:50 -0800 (PST)
- Subject: [commit] Remove unnecessary reading of dwarf2 abbrev table
- Authentication-results: mr.google.com; spf=pass (google.com: domain of dje@google.com designates 10.14.122.69 as permitted sender) smtp.mail=dje@google.com; dkim=pass header.i=dje@google.com
Hi.
I've committed this.
There's no need for load_full_comp_unit to read the abbrev table,
read_comp_unit will do it.
Regression tested on amd64-linux.
2012-03-01 Doug Evans <dje@google.com>
* dwarf2read.c (load_full_comp_unit): Remove unnecessary reading of
abbrev table, read_comp_unit will do it.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.616
diff -u -p -r1.616 dwarf2read.c
--- dwarf2read.c 1 Mar 2012 19:55:35 -0000 1.616
+++ dwarf2read.c 2 Mar 2012 00:41:45 -0000
@@ -4655,7 +4655,7 @@ load_full_comp_unit (struct dwarf2_per_c
struct dwarf2_cu *cu;
unsigned int offset;
gdb_byte *info_ptr, *beg_of_comp_unit;
- struct cleanup *free_abbrevs_cleanup = NULL, *free_cu_cleanup = NULL;
+ struct cleanup *free_cu_cleanup = NULL;
struct attribute *attr;
int read_cu = 0;
@@ -4694,10 +4694,6 @@ load_full_comp_unit (struct dwarf2_per_c
cu->header.offset = offset;
cu->header.first_die_offset = info_ptr - beg_of_comp_unit;
- /* Read the abbrevs for this compilation unit. */
- dwarf2_read_abbrevs (cu);
- free_abbrevs_cleanup = make_cleanup (dwarf2_free_abbrev_table, cu);
-
/* Link this CU into read_in_chain. */
per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
dwarf2_per_objfile->read_in_chain = per_cu;
@@ -4724,8 +4720,6 @@ load_full_comp_unit (struct dwarf2_per_c
if (read_cu)
{
- do_cleanups (free_abbrevs_cleanup);
-
/* We've successfully allocated this compilation unit. Let our
caller clean it up when finished with it. */
discard_cleanups (free_cu_cleanup);