public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: peter0x44 <peter0x44@disroot.org>
To: gdb@sourceware.org
Subject: Assertion `pc_in_thread_step_range (pc, tp)' failed when executing int3 instruction
Date: Sat, 16 Dec 2023 01:45:16 +0000	[thread overview]
Message-ID: <54e8eb183fec7cd01bec92ba23b83863@disroot.org> (raw)

For the following code:

#include <stdio.h>

int main(void)
{
     __asm__("int3");
     // give code to step through
     for (int i = 0; i < 10; ++i)
     {
         printf("%d\n", i);
     }
}
Compiled with:
gcc -o int3 -g3 -O2

When I try debugging under GDB 13.2, I get the following:

0x7fb54815cd89 ???
0x558eebc578e4 ???
0xffffffffffffffff ???
---------------------
../../gdb/infrun.c:2640: internal-error: resume_1: Assertion 
`pc_in_thread_step_range (pc, tp)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

This instruction seems to be the standard way to implement a breakpoint 
from code.
Clang has an intrinsic __builtin_debugtrap() which generates it, and 
Microsoft Visual C++ generates it from __debugbreak().

             reply	other threads:[~2023-12-16  1:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16  1:45 peter0x44 [this message]
2023-12-29 16:29 ` Simon Marchi

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=54e8eb183fec7cd01bec92ba23b83863@disroot.org \
    --to=peter0x44@disroot.org \
    --cc=gdb@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: link
Be 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).