From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D1973858424; Tue, 14 Sep 2021 12:41:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D1973858424 From: "cvs-commit 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: Tue, 14 Sep 2021 12:41:31 +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: cvs-commit 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: 12.1 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: Tue, 14 Sep 2021 12:41:32 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28200 --- Comment #14 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D211aafd18d10= b7739a16df5cc637952fd3f508e8 commit 211aafd18d10b7739a16df5cc637952fd3f508e8 Author: Tom de Vries Date: Tue Sep 14 14:41:27 2021 +0200 [gdb/symtab] Fix function range handling in psymtabs Consider the test-case from this patch. We run into: ... (gdb) PASS: gdb.dwarf2/dw2-ranges-psym-warning.exp: continue bt^M warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M ^M warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M ^M warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M ^M warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M ^M warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M ^M warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M ^M read in psymtab, but not in symtab.)^M ^M )^M (gdb) FAIL: gdb.dwarf2/dw2-ranges-psym-warning.exp: bt ... This happens as follows. The function foo: ... <1><31>: Abbrev Number: 4 (DW_TAG_subprogram) <33> DW_AT_name : foo <37> DW_AT_ranges : 0x0 ... has these ranges: ... 00000000 00000000004004c1 00000000004004d2 00000000 00000000004004ae 00000000004004af 00000000 ... which have a hole at at [0x4004af,0x4004c1). However, the address map of the partial symtabs incorrectly maps addres= ses in the hole (such as 0x4004b6 in the backtrace) to the foo CU. The address map of the full symbol table of the foo CU however does not contain the addresses in the hole, which is what the warning / internal error complains about. Fix this by making sure that ranges of functions are read correctly. The patch adds a bit to struct partial_die_info, in this hole (shown for x86_64-linux): ... /* 11: 7 | 4 */ unsigned int canonical_name : 1; /* XXX 4-byte hole */ /* 16 | 8 */ const char *raw_name; ... So there's no increase in size for 64-bit, but AFAIU there will be an increase for 32-bit. Tested on x86_64-linux. gdb/ChangeLog: 2021-08-10 Tom de Vries PR symtab/28200 * dwarf2/read.c (struct partial_die_info): Add has_range_info a= nd range_offset field. (add_partial_subprogram): Handle pdi->has_range_info. (partial_die_info::read): Set pdi->has_range_info. gdb/testsuite/ChangeLog: 2021-08-10 Tom de Vries PR symtab/28200 * gdb.dwarf2/dw2-ranges-psym-warning-main.c: New test. * gdb.dwarf2/dw2-ranges-psym-warning.c: New test. * gdb.dwarf2/dw2-ranges-psym-warning.exp: New file. --=20 You are receiving this mail because: You are on the CC list for the bug.=