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

Simon Marchi via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>

On 2023-12-15 20:45, peter0x44 via Gdb wrote:
> 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().

I think that this bug is for the same thing, so discussions are going to happen there.

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

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