public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/symtab] Use comp_unit_head::get_length
@ 2022-07-11 9:36 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-07-11 9:36 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a4ca6efe0589d0a030920a4686b692208c82a028
commit a4ca6efe0589d0a030920a4686b692208c82a028
Author: Tom de Vries <tdevries@suse.de>
Date: Mon Jul 11 11:36:54 2022 +0200
[gdb/symtab] Use comp_unit_head::get_length
There's a spot in read_comp_units_from_section where we explictly use
initial_length_size to get the total length:
...
this_cu->length = cu_header.length + cu_header.initial_length_size;
...
Instead, just use cu_header.get_length ().
Tested on x86_64-linux.
Diff:
---
gdb/dwarf2/read.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 55e61b882a9..40a18796f8d 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7207,7 +7207,7 @@ read_comp_units_from_section (dwarf2_per_objfile *per_objfile,
*slot = sig_ptr;
}
this_cu->sect_off = sect_off;
- this_cu->length = cu_header.length + cu_header.initial_length_size;
+ this_cu->length = cu_header.get_length ();
this_cu->is_dwz = is_dwz;
this_cu->section = section;
/* Init this asap, to avoid a data race in the set_version in
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-11 9:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 9:36 [binutils-gdb] [gdb/symtab] Use comp_unit_head::get_length Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).