From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2502B396BC04; Fri, 6 Aug 2021 13:18:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2502B396BC04 From: "simark at simark dot ca" 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 13:18:51 +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: simark at simark dot ca 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 13:18:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28200 --- Comment #3 from Simon Marchi --- (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 bei= ng > called with cu_bounds_kind =3D=3D PC_BOUNDS_INVALID, which sets the set_a= ddrmap > argument to 1: > ... > scan_partial_symbols (first_die, &lowpc, &highpc, > cu_bounds_kind <=3D PC_BOUNDS_INVALID, cu= ); > ... I'm trying to reproduce to understand better what you mean and I lose you h= ere. I'm at: (top-gdb) frame #0 process_psymtab_comp_unit_reader (reader=3D0x7fffffffc3e0, info_ptr=3D0x60c000014faa "\003\004\005integer", comp_unit_die=3D0x62100016= 3110, 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) And cu_bounds_kind is: (top-gdb) p cu_bounds_kind $9 =3D PC_BOUNDS_RANGES Not PC_BOUNDS_INVALID. This is with the test case modified as you explained, with the separate but contiguous ranges: 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)) --=20 You are receiving this mail because: You are on the CC list for the bug.=