From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 62F3039A24B9; Fri, 6 Aug 2021 14:28:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62F3039A24B9 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/28200] DW_AT_ranges handling in partial_die_info::read does not handle discontinuous ranges Date: Fri, 06 Aug 2021 14:28:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 14:28:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28200 --- Comment #5 from Tom de Vries --- (In reply to Simon Marchi from comment #3) > (In reply to Tom de Vries from comment #0) > > What happens here, is that gdb puts together the address map from the > > functions, triggered by this code in process_psymtab_comp_unit_reader b= eing > > called with cu_bounds_kind =3D=3D PC_BOUNDS_INVALID, which sets the set= _addrmap > > argument to 1: > > ... > > scan_partial_symbols (first_die, &lowpc, &highpc, > > cu_bounds_kind <=3D PC_BOUNDS_INVALID, = cu); > > ... >=20 > I'm trying to reproduce to understand better what you mean and I lose you > here. I'm at: >=20 > (top-gdb) frame > #0 process_psymtab_comp_unit_reader (reader=3D0x7fffffffc3e0, > info_ptr=3D0x60c000014faa "\003\004\005integer", comp_unit_die=3D0x621000= 163110, > pretend_language=3Dlanguage_minimal) at > /home/simark/src/binutils-gdb/gdb/dwarf2/read.c:6941 > 6941 if (cu_bounds_kind =3D=3D PC_BOUNDS_HIGH_LOW && best_lowpc < > best_highpc) >=20 >=20 > And cu_bounds_kind is: >=20 > (top-gdb) p cu_bounds_kind > $9 =3D PC_BOUNDS_RANGES >=20 > Not PC_BOUNDS_INVALID. >=20 > This is with the test case modified as you explained, with the separate b= ut > contiguous ranges: >=20 > 0x0000000b: DW_TAG_compile_unit > DW_AT_language [DW_FORM_sdata] (2) > DW_AT_name [DW_FORM_string] ("dw-ranges-psym.c") > DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) > DW_AT_ranges [DW_FORM_sec_offset] (0x00000040 > [0x000000000000113e, 0x0000000000001159) > [0x000000000000112b, 0x000000000000112c) > [0x000000000000112c, 0x0000000000001137) > [0x0000000000001137, 0x000000000000113e) > [0x0000000000001124, 0x000000000000112b)) AFAIU, the "separate but contiguous ranges" maps to case II. Indeed, in case II we expect to see PC_BOUNDS_RANGES (and the same in case I and III). It's only in case IV that we expect something different: PC_BOUND_NOT_PRESENT (not PC_BOUNDS_INVALID, my mistake). --=20 You are receiving this mail because: You are on the CC list for the bug.=