From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 016743AA8CBF; Fri, 6 Aug 2021 11:57:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 016743AA8CBF 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 11:57:08 +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 11:57:09 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28200 --- Comment #2 from Tom de Vries --- Essentially, there are two interpretations of has_pc_info: - this is not something to be ignored, build a symbol in the partial symbol table - the field lowpc and highpc are valid. The code: ... if (dwarf2_ranges_read (ranges_offset, &lowpc, &highpc, cu, nullptr, tag)) has_pc_info =3D 1; ... uses the first interpretation to fix the problem that a symbol is not liste= d in the partial symbol table. Which also implies the second interpretation, which apparently usually does= n't cause much trouble, but evidently it does in combination with this workarou= nd for gcc 4.8 (see PR15231): ... scan_partial_symbols (first_die, &lowpc, &highpc, cu_bounds_kind <=3D PC_BOUNDS_INVALID, cu); ... So, at this point I see two potential solutions: - add an address map along side lowpc/highpc and pass that instead of nullp= tr to=20 dwarf2_ranges_read, and handle things from there-on - split up the two interpretations of has_pc_info, say by adding highlowpc_valid (or have_ranges), and when encountering DW_AT_ranges just mark highlowpc_valid =3D 0 and has_pc_info =3D 1, and deferring read= ing the ranges till we have the partial symtab address map to work with. My guess is that the latter is more space-efficient. --=20 You are receiving this mail because: You are on the CC list for the bug.=