SDL-1.3: Breakpoint after int main

Hello !

A strange thing is happening :—

(natty)wizard at wizardspc:/tmp/SDL-1.3/test$ gdb testsprite2
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright © 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and “show warranty” for details.
This GDB was configured as “i686-linux-gnu”.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/
Reading symbols from /tmp/SDL-1.3/test/testsprite2…done.
Breakpoint 1 at 0x804a07c: file ./testsprite2.c, line 220.


I get a breakpoint message at line 220 in
testsprite2 and not only there, without setting one ?!?!

Line 220 in testsprite2.c is :


SDL_RenderPresent(renderer);

}

int
main(int argc, char *argv[])
{ <----- This is line 220.


Is there a way to set a breakpoint in C/C++ code directly ?

CU

I get a breakpoint message at line 220 in
testsprite2 and not only there, without setting one ?!?!
int
main(int argc, char *argv[])
{<----- This is line 220.

This is because there’s a .gdbinit file in the test directory.

(Which drives me nuts, but it’s been there for more than a decade.)

Is there a way to set a breakpoint in C/C++ code directly ?

Several ways.

On Unix: raise(SIGTRAP);
On Windows: DebugBreak();

Or, on x86 or x86-64 Linux, you can trigger software interrupt 3, which
will tell GDB to act as if it hit a breakpoint.

 __asm__ __volatile__ ( "int $3\n" );

–ryan.

Hello !

I get a breakpoint message at line 220 in
testsprite2 and not only there, without setting one ?!?!
int
main(int argc, char *argv[])
{<----- This is line 220.

This is because there’s a .gdbinit file in the test directory.

(Which drives me nuts, but it’s been there for more than a decade.)

Is there a way to set a breakpoint in C/C++ code directly ?

Several ways.

On Unix: raise(SIGTRAP);
On Windows: DebugBreak();

Or, on x86 or x86-64 Linux, you can trigger software interrupt 3, which will tell GDB to act as if it hit a breakpoint.

__asm__ __volatile__ ( "int $3\n" );

Always learning new stuff here :slight_smile: Thanks !

@ Sam Lantinga :

Any chance of removing it ?

CU

Done! :)On Fri, Dec 2, 2011 at 7:06 AM, Torsten Giebl wrote:

Hello !

I get a breakpoint message at line 220 in
testsprite2 and not only there, without setting one ?!?!
int
main(int argc, char *argv[])
{<----- This is line 220.

This is because there’s a .gdbinit file in the test directory.

(Which drives me nuts, but it’s been there for more than a decade.)

Is there a way to set a breakpoint in C/C++ code directly ?

Several ways.

On Unix: raise(SIGTRAP);
On Windows: DebugBreak();

Or, on x86 or x86-64 Linux, you can trigger software interrupt 3, which
will tell GDB to act as if it hit a breakpoint.

__asm__ __volatile__ ( "int $3\n" );

Always learning new stuff here :slight_smile: Thanks !

@ Sam Lantinga :

Any chance of removing it ?

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org