From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2A3553851C06; Mon, 8 Jun 2020 08:34:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A3553851C06 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/26092] New: Complain about contradictory DW_LNE_end_sequence marker Date: Mon, 08 Jun 2020 08:34:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Mon, 08 Jun 2020 08:34:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26092 Bug ID: 26092 Summary: Complain about contradictory DW_LNE_end_sequence marker Product: gdb Version: HEAD Status: NEW Severity: enhancement Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider test-case gdb.dwarf2/dw2-ranges-base.exp. It has a line-table for dw2-ranges-base.c like this: ... Line Number Statements: [0x0000014e] Extended opcode 2: set Address to 0x4004ba [0x00000159] Advance Line by 10 to 11 [0x0000015b] Copy [0x0000015c] Advance PC by 12 to 0x4004c6 [0x0000015e] Advance Line by 19 to 30 [0x00000160] Copy [0x00000161] Extended opcode 1: End of Sequence [0x00000164] Extended opcode 2: set Address to 0x4004ae [0x0000016f] Advance Line by 20 to 21 [0x00000171] Copy [0x00000172] Advance PC by 12 to 0x4004ba [0x00000174] Advance Line by 29 to 50 [0x00000176] Copy [0x00000177] Extended opcode 1: End of Sequence [0x0000017a] Extended opcode 2: set Address to 0x4004a7 [0x00000185] Advance Line by 30 to 31 [0x00000187] Copy [0x00000188] Advance PC by 7 to 0x4004ae [0x0000018a] Advance Line by 39 to 70 [0x0000018c] Copy [0x0000018d] Extended opcode 1: End of Sequence ... The Copy followed by End-of-Sequence is as specified in the dwarf assembly,= but incorrect. F.i., consider: ... [0x0000015c] Advance PC by 12 to 0x4004c6 [0x0000015e] Advance Line by 19 to 30 [0x00000160] Copy [0x00000161] Extended opcode 1: End of Sequence ... Both the Copy and the End-of-Sequence append a row to the matrix using the = same addres: 0x4004c6. The Copy declares a target instruction at that address. The End-of-Sequence declares that the sequence ends before that address. It's a contradiction that the target instruction is both part of the sequen= ce (according to Copy) and not part of the sequence (according to End-of-Sequence). [ Relevant dwarf standard bits: DW_LNS_copy The DW_LNS_copy opcode takes no operands. It appends a row to the matrix us= ing the current values of the state machine registers. Then it sets the discriminator register to 0, and sets the basic_block, prologue_end and epilogue_begin registers to =E2=80=9Cfalse.=E2=80=9D end_sequence: A boolean indicating that the current address is that of the first byte after the end of a sequence of target machine instructions. end_sequence terminates a sequence of lines; therefore other information in the same row is not meaningful. DW_LNE_end_sequence: The DW_LNE_end_sequence opcode takes no operands. It sets the end_sequence register of the state machine to =E2=80=9Ctrue=E2=80=9D and ap= pends a row to the matrix using the current values of the state-machine registers. Then it resets the registers to the initial values specified above (see Section 6.2.2). Every line number program sequence must end with a DW_LNE_end_sequence instruction which creates a row whose address is that of the byte after the last target machine instruction of the sequence. ] The offending Copy is currently silently skipped by buildsym_compunit::record_line. It would be good to warn about this invalid use of dwarf, through the complaints mechanism, or some such. --=20 You are receiving this mail because: You are on the CC list for the bug.=