Assertion `pc_in_thread_step_range (pc, tp)' failed when executing int3 instruction

peter0x44 via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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().
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.