public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/97774] New: Incorrect line info for try/catch Date: Tue, 10 Nov 2020 09:34:13 +0000 [thread overview] Message-ID: <bug-97774-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97774 Bug ID: 97774 Summary: Incorrect line info for try/catch Product: gcc Version: 7.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- [ This PR is FTR, it's already fixed. ] Consider this test-case, minimized from gdb.cp/gdb9593.cc ( https://src.fedoraproject.org/rpms/gdb/blob/master/f/gdb-archer-vla-tests.patch ): ... $ cat -n test.cc 1 void 2 function1 (void) 3 { 4 throw 20; 5 } 6 7 int 8 main (void) 9 { 10 try 11 { 12 function1 (); 13 } 14 catch (int x) 15 { 16 } 17 18 return 0; 19 } ... We compile using gcc 7.5.0: ... $ g++ -g test.cc -save-temps -dA ... When trying to step over function1 using next, we end up on line 18, and not at the start of line 18 (given the $hex prefix): ... $ gdb a.out -ex start -ex next Reading symbols from a.out... Temporary breakpoint 1 at 0x4007b5: file test.cc, line 12. Starting program: a.out Temporary breakpoint 1, main () at test.cc:12 12 function1 (); 0x00000000004007c1 18 return 0; (gdb) ... This is caused by the following. There's a .loc for line 18 after the call to function1, but then we jump away to label .L9: ... # test.cc:12 .loc 1 12 0 call _Z9function1v .LEHE0: # BLOCK 3 seq:1 # PRED: 2 (FALLTHRU) 6 [100.0%] .L7: # test.cc:18 .loc 1 18 0 movl $0, %eax # SUCC: 7 [100.0%] jmp .L9 # BLOCK 4 seq:2 # PRED: 2 (ABNORMAL,ABNORMAL_CALL,EH) .L8: cmpq $1, %rdx ... Since there's no other loc before the insn at .L8, it's considered to be part of line 18.
next reply other threads:[~2020-11-10 9:34 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-10 9:34 vries at gcc dot gnu.org [this message] 2020-11-10 9:42 ` [Bug debug/97774] " vries at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-97774-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).