#84 - bomberman - Thu Jan 02, 2003 3:08 pm
That's it...
I compiled my first program (only displaying colors on the screen, well that's a start....) using DevKitAdvance. I can run it in VisualBoyAdvance 1.3.1, no problem!
Things got tougher when I wanted to debug this. I downloaded GDB/Insight 5.1.1. I managed to load the image in VBA and wait for a GDB connection. I then ask GDB to connect to target (using TCP). It succeeds but the only thing I can do is clicking on continue and see my program running.
In other words, I can not put breakpoints at source level and/or step into my program.
Has someone here already done this? Or has someone used other tools to achieve this?
Thanks for your help!
#87 - I.C.E - Thu Jan 02, 2003 3:39 pm
First of all I dont use GDB/Insight i am using GDB/DDD, but nevertheless I think i can give you some advices. :)
I really deapreciate using TCP for debugging, because it is really slow (at least here at my Linux box). Pipe is much faster.
To find the problem i would suggest that you first try to debug you game with gdb. You need for debugging the elf binary of you program and the gba binary.
Just start gdb in the directory where both files are. Enter file <elffile> and then enter the remote target with the command target remote |VisualBoyAdvance -s0 -Gpipe <gbafile> . Now you should easy can use gdb commands, for e.g break <functionname> to enter a break point. If that should work the problem has something to do with Insight. Is the correct debugger configured? (a common error is that gdb is used instead of the correct arm compiled gdb)
Btw, i often use .gdbinit files to initialate gdb correct for my needs (breakpoint i often need and so on)
#88 - bomberman - Thu Jan 02, 2003 4:45 pm
The GDB I use is named arm-gdb.exe (I found it on http://vboy.emuhq.com/downloads.shtml, the site of VBA) so I assume it's the right one.
If I open the elf (either by menu or your command in the console), the source appears in GDB.
Unfortunately, you are using a pipe to connect to VBA, but I read on the VBA site it only works for Unix and not for Windows (yes I work on it...).
I tried to run VisualBoyAdvance -Gtcp <gbafile> and it waits for a connection. In Insight I select Connect Target with TCP and it succeeds. Both say they are connected to each other. But then I have only assembly code in GDB window. I lose my C++ source files and can only run it.
I'll have a look to see if DDD is available on Windows and if yes will try with that.
Thanks, I keep on working on it...
#90 - bomberman - Thu Jan 02, 2003 5:48 pm
OK... I was using VBA and it seems it does not work.
I run VBA-SDL.exe -Gtcp <gbafile> and then gdb can connect to it.
But I have then to setup all my breakpoints before running or while I am in a break point. I can not setup a breakpoint when the program is running (which Visual C++ lets you do for example). Is this a normal behaviour?
#92 - I.C.E - Thu Jan 02, 2003 5:53 pm
Hmm, i would suggest you try it first with gdb (without insight) to see if everything is correct with your files and gdb. But maybe you just have not compiled with debugging informations? Do you have the option -g when compiling whith gcc on?
#93 - bomberman - Thu Jan 02, 2003 6:04 pm
as you saw I managed using VBA-SDL.
I presume on Linux VBA is de facto VBA-SDL so it's why it works. On Windows it is Direct-X.
Do you have a clue concerning the breakpoints?
Thanks for all!
#94 - I.C.E - Thu Jan 02, 2003 6:16 pm
Usually it is possible to interrupt a running program and then set breakpoint or do another stuff with gdb, but with VisualBoyAdvance as remote target it also does not work on my machine, but don't know why.
#102 - tubooboo - Thu Jan 02, 2003 8:46 pm
...is actually easy. Just press F11 while the VBA window is active, that will break back into GDB.
Also have a look at HAMs GDB source level debugging system if you need info on how to set it up.
Best
Emanuel
_________________
HAM author
http://www.ngine.de
#104 - I.C.E - Thu Jan 02, 2003 9:37 pm
Oh, that is really cool, thanks. :)
#657 - mithris - Thu Jan 09, 2003 2:12 pm
Has anyone bought the XPort?
It says on the page that it should support source level debugging, and it sure
does, but only when running from RAM.
The problem is how gdb sets it's breakpoints, but since the XPort has a FPGA
circuit there is possible to add hardware breakpoints to ROM-based code.
I wrote a small program that talks to GDB through a UART cable, but i don't
have the software to program the XILINX FPGA mounted on the xport, so i
wonder if anyone here has the required software and would like to be
involved in this project?
/Bjorn
_________________
codito ergo sum
#662 - Lanza - Thu Jan 09, 2003 3:06 pm
This might be of some interest :
I am currently beta testing the last version of batgba (www.bgba.tk). It has source level debugging, and is very eficient.
I hope it will be released soon, but this depends of the developpers. (I am just a tester).