This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove one argument abbrev_len in read_partial_die


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=35cc7ed70ced98eedf9c065faa602abb1dfac537

commit 35cc7ed70ced98eedf9c065faa602abb1dfac537
Author: Yao Qi <yao.qi@linaro.org>
Date:   Mon Feb 26 15:38:01 2018 +0000

    Remove one argument abbrev_len in read_partial_die
    
    gdb:
    
    2018-02-26  Yao Qi  <yao.qi@linaro.org>
    
    	* dwarf2read.c (read_partial_die): Update the declaration.
    	(load_partial_dies): Caller update.
    	(read_partial_die): Remove one argument abbrev_len.

Diff:
---
 gdb/ChangeLog    |  6 ++++++
 gdb/dwarf2read.c | 12 +++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 24d3f0a..d4b7116 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2018-02-26  Yao Qi  <yao.qi@linaro.org>
 
+	* dwarf2read.c (read_partial_die): Update the declaration.
+	(load_partial_dies): Caller update.
+	(read_partial_die): Remove one argument abbrev_len.
+
+2018-02-26  Yao Qi  <yao.qi@linaro.org>
+
 	* dwarf2read.c (struct partial_die_info): Add ctor, delete
 	assignment operator.
 	(load_partial_dies): Use ctor and copy ctor.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 3954175..20bfb0b 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1834,7 +1834,6 @@ static struct partial_die_info *load_partial_dies
 static const gdb_byte *read_partial_die (const struct die_reader_specs *,
 					 struct partial_die_info *,
 					 const struct abbrev_info &,
-					 unsigned int,
 					 const gdb_byte *);
 
 static struct partial_die_info *find_partial_die (sect_offset, int,
@@ -18351,8 +18350,8 @@ load_partial_dies (const struct die_reader_specs *reader,
       struct partial_die_info pdi ((sect_offset) (info_ptr - reader->buffer),
 				   abbrev);
 
-      info_ptr = read_partial_die (reader, &pdi, *abbrev, bytes_read,
-				   info_ptr);
+      info_ptr = read_partial_die (reader, &pdi, *abbrev,
+				   (const gdb_byte *) info_ptr + bytes_read);
 
       /* This two-pass algorithm for processing partial symbols has a
 	 high cost in cache pressure.  Thus, handle some simple cases
@@ -18527,12 +18526,13 @@ partial_die_info::partial_die_info (sect_offset sect_off_,
 {
 }
 
-/* Read a minimal amount of information into the minimal die structure.  */
+/* Read a minimal amount of information into the minimal die structure.
+   INFO_PTR should point just after the initial uleb128 of a DIE.  */
 
 static const gdb_byte *
 read_partial_die (const struct die_reader_specs *reader,
 		  struct partial_die_info *part_die,
-		  const struct abbrev_info &abbrev, unsigned int abbrev_len,
+		  struct abbrev_info *abbrev, unsigned int abbrev_len,
 		  const gdb_byte *info_ptr)
 {
   struct dwarf2_cu *cu = reader->cu;
@@ -18546,8 +18546,6 @@ read_partial_die (const struct die_reader_specs *reader,
   int has_high_pc_attr = 0;
   int high_pc_relative = 0;
 
-  info_ptr += abbrev_len;
-
   for (i = 0; i < abbrev.num_attrs; ++i)
     {
       info_ptr = read_attribute (reader, &attr, &abbrev.attrs[i], info_ptr);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]