From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 0D63D3858412; Mon, 11 Jul 2022 09:36:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D63D3858412 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/symtab] Use comp_unit_head::get_length X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: b2657999964250911846e947a23093507fe084fa X-Git-Newrev: a4ca6efe0589d0a030920a4686b692208c82a028 Message-Id: <20220711093658.0D63D3858412@sourceware.org> Date: Mon, 11 Jul 2022 09:36:58 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 09:36:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da4ca6efe0589= d0a030920a4686b692208c82a028 commit a4ca6efe0589d0a030920a4686b692208c82a028 Author: Tom de Vries Date: Mon Jul 11 11:36:54 2022 +0200 [gdb/symtab] Use comp_unit_head::get_length =20 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 =3D cu_header.length + cu_header.initial_length_s= ize; ... =20 Instead, just use cu_header.get_length (). =20 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 =3D sig_ptr; } this_cu->sect_off =3D sect_off; - this_cu->length =3D cu_header.length + cu_header.initial_length_size; + this_cu->length =3D cu_header.get_length (); this_cu->is_dwz =3D is_dwz; this_cu->section =3D section; /* Init this asap, to avoid a data race in the set_version in