Debuggin SDL

I am wondering if anyone with experience might know what I’m doing wrong or
might help clarify my situation.

I am using SDL and OpenGL on Linux. I’m using the development environment
Kdevelop. It uses GDB for debugging I believe. The problem I’m having is that
I can’t debug SDL at all. I have gotten by for quite awhile without this;
currently I am just coding intuitively and using an occasional output to console
if I have a question about state. At the rate this type of application runs
that can actually be more informative anyway. But occasionally it would be nice
to catch an event or step through some logic stepwise.

Here is a more thorough description of the issue:

  1. If I take the KDevelop-generated sample SDL app and try to debug that, I can
    stop on the first line (which is a cout I believe). The next line tries to call
    SDL_Init or whatever it is. That line seems to freeze up the debugger whether I
    step into or step over. On this sample app, consisting of only a few lines I
    can sometimes set another breakpoint after that call, which is another cout, and
    hit the breakpoint again. But not always, and after that other SDL calls
    sometimes have a similar effect.

  2. In my own application, I can stop somewhere near the beginning again, but
    again as soon as I make my first SDL call I lose control of the debugger. My
    app is considerably more complex than the sample app mentioned above, and it
    also uses OpenGL, importing the SDL_opengl.h header. I don’t think that’s
    relevant since the sample app has the same probem but I’m including that
    information anyway.

If I run the app everything runs fine, so I’m pretty sure I’m including the
right link switches.

Is it because I don’t have the development version of the sdl libraries so
there’s no debugging symbols? I would think not because I can’t even step OVER
sdl calls. I would expect to be able to do that.

I’m using fedora core 2, though it’s no longer stock – kde 3.2 and various
other upgrades via apt/upgrade if that helps.

I’m a fairly experienced developer but I’m just a newbie on linux development
issues and tools so I hope you’ll forgive any naiveties and help me get better
at this.

I can pull the code in under windows using VC++6 and debug without incident.

Thanks for your kind consideration of my question. If any of you have seen this
and overcome it, or just know what I in my ignorance do not know, I appreciate
your response.

Chronologic

chronologic <hateyourjunkmail yahoo.com> writes:

I am wondering if anyone with experience might know what I’m doing wrong or
might help clarify my situation.

I am using SDL and OpenGL on Linux. I’m using the development environment
Kdevelop. It uses GDB for debugging I believe. The problem I’m having is
that
I can’t debug SDL at all.

Chronologic,
I’m very new to SDL programming, so don’t take my word for it, but I seem to
remember reading that you have to pass the ?SDL_INIT_NOPARACHUTE? flag when you
call SDL_Init() to allow your debugger to work properly. I hope that helps.

Anthony