public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "blarsen at redhat dot com" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug record/30025] Adding an inferior when already recording makes GDB not handle SIGTRAP correctly Date: Thu, 19 Jan 2023 15:42:51 +0000 [thread overview] Message-ID: <bug-30025-4717-64ZjObDI3b@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-30025-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=30025 --- Comment #1 from B. Larsen <blarsen at redhat dot com> --- Upon further inspection, its not nat the state of inferior 1 is corrupted. Instead, GDB just doesn't handle the SIGTRAP correctly. Looking at the $PCs when stepping to the factorial function, we have: Program received signal SIGTRAP, Trace/breakpoint trap. 0x0000000000401107 in fact (n=32767) at t.c:1 1 int fact(int n){ (gdb) p $pc $1 = (void (*)()) 0x401107 <fact+1> (gdb) si 0x000000000040110a 1 int fact(int n){ (gdb) 0x000000000040110e 1 int fact(int n){ (gdb) 2 if (n<2) return n; (gdb) p $pc $2 = (void (*)()) 0x401111 <fact+11> While the exact same session without recording inferior 1 looks like this: (gdb) s fact (n=5) at t.c:2 2 if (n<2) return n; (gdb) p $pc $1 = (void (*)()) 0x401111 <fact+11> Seems clear to me that instead of continuing execution until we were at an "is_stmt", GDB is just stopping at the instruction that received the sigtrap -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2023-01-19 15:42 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-19 11:32 [Bug record/30025] New: Adding an inferior when already recording corrupts the first inferior state blarsen at redhat dot com 2023-01-19 15:34 ` [Bug record/30025] Adding an inferior when already recording makes GDB not handle SIGTRAP correctly blarsen at redhat dot com 2023-01-19 15:42 ` blarsen at redhat dot com [this message] 2023-01-25 17:07 ` blarsen at redhat dot com 2024-04-03 20:10 ` blarsen at redhat dot com
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-30025-4717-64ZjObDI3b@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.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).