gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Weird GDB Error when stepping

#76519 - ion - Wed Mar 22, 2006 10:38 am

Hi all,

I've a setup involving Eclipse as my IDE and I was able to debug in Eclipse using GDB. Recently I redesign some of my code to make it more modular. I'm new-ish to C so was learning as I went along. For some reason when now debugging is not working. I can connect remotely you to the debugger and VisualBoyAdvance is working (as I said the setup was working fine). The GDB server fails with the following message

Code:
Single stepping until exit from function __do_global_dtors_aux,
which has no line number information.
Cannot find bounds of current function


In the debug box the trace is the following.

Code:

GDB Server (22/03/06 09:35) (Suspended)
   Thread [0] (Suspended)
      2 __do_global_dtors_aux()  0x02000260
      1 <symbol is not available> 0x0200ddc0



Any idea why this may be happening. I'm running on windows and have ZERO experience with GDB, Linux, etc...

ION

#76521 - ion - Wed Mar 22, 2006 11:06 am

I'm just wondering does it have anything to do with where my code is placed.

Code:

int main(void)
{   
   // initialise ship system
   ship_initialise();
   // initialise background system
   bg_initialise();

   //set video mode 0 with background 0
   SetMode(MODE_0 | BG0_ENABLE | BG1_ENABLE | OBJ_ENABLE | OBJMAP_1D);
   
   //main game loop
   while(1)
   {
      // poll for key changes
      key_poll();
      // update ship movements
      ship_update();
      // set ship to display
      ship_display();
      // update the backgrounds
      bg_update();
      
      //wait for vertical refresh
      VSync();
      
      bg_display();
      // update all sprites in memory
      update_oam();
   }
   return 0;
}


Here's my int main. seems the problem occurs when I hit ship_initialise(). ship.c has some defines, a struct representing my ship and some support functions. ship.h then has the public interface.

ION

#76562 - KayH - Wed Mar 22, 2006 7:06 pm

Not sure about that, but the debugger complains about missing symbols. That seems not to be related to source code. I would assume it is related to your build process. Do you use optimization (o)? Can you try it without optimization? I'm not really familiar with that, but for debugging optimization is not so good.

hth
KaY

#76563 - ion - Wed Mar 22, 2006 7:10 pm

hey. how's it going..

http://forum.gbadev.org/viewtopic.php?t=8999

I just posted another question that I ended up explaining my setup. I was using devkitARM R17 and Insight/GDB 6.4.50. It was kinda working and then just suddenly stopped. I tried R12 and R8 and they worked but they're still screwing up. I ended up reinstalling R17 and the debugging is working but shows same problems as R8 and R12. Need more info?

ION

#76753 - gmiller - Fri Mar 24, 2006 6:50 am

If you do not have an -O0 (Letter O followed by number 0) in your compile steps you will have a hard time using a source code debugger. With GDB there are problems when using vba 1.7.2 or higher and the debugger (gdb not the internal debugger). The earlyier release of vba has some issues with gdb's Next command but not as many as the newer releases. Of course you dud not let us know the command line arguments for the compile or what emulator you ar using so I am "guessing".

#77029 - ion - Mon Mar 27, 2006 4:19 pm

Code:

CFLAGS  := -I./ $(MODEL) -O0 -Wall


That's my makefile CFLAGS. Using VBA (various SDL versions). Haven't been near it in a couple of days so not too sure if the problem is still there. I'll keep you posted.

Cheers,
ION