public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31896] New: -exec-next skips statements
@ 2024-06-14 10:05 dmitry.neverov at jetbrains dot com
  2024-06-14 12:54 ` [Bug gdb/31896] " tromey at sourceware dot org
  2024-06-14 13:36 ` dmitry.neverov at jetbrains dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dmitry.neverov at jetbrains dot com @ 2024-06-14 10:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31896

            Bug ID: 31896
           Summary: -exec-next skips statements
           Product: gdb
           Version: 14.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dmitry.neverov at jetbrains dot com
  Target Milestone: ---

I'm debugging the following code, the at line1 (v == 0):

  if (v) { // line1
    // branch1
  } else if (predicate()) { // line2
    // branch2
  }
  else 
  {
    // branch3, line3
  }

When I issue the `next` command, execution stops at line3 instead of
line2. If I change the code and add a newline before the 'else if',
`next` stops at line2 as expected:

  if (condition1) { // line1
    // branch1
  }
  else if (predicate()) { // line2
    // branch2
  }
  else 
  {
    // branch3, line3
  }

It looks like it happens because the last jump instruction in first
branch has the line2.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-14 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14 10:05 [Bug gdb/31896] New: -exec-next skips statements dmitry.neverov at jetbrains dot com
2024-06-14 12:54 ` [Bug gdb/31896] " tromey at sourceware dot org
2024-06-14 13:36 ` dmitry.neverov at jetbrains dot com

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).