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 > Insight VBA Help!

#18002 - regularkid - Thu Mar 18, 2004 8:20 am

Ok, I can't seem to get insight working with VisualBoy advance on windows me. I've looked all over these forums for help and on the internet but can't seem to find a step by step tutorial on setting it up correctly. So heres what I've done:

1. Downloaded insight and the tcl files that go into ...share\ (where ... is where I installed insight).
2. I have my .elf compiled with -g and running in visualboy advance.
3. I go to Tools->GDB->Load And Wait. Then I select my .elf and leave the default port to 55555.
4. I then open up insight.

Here is where I'm stuck. I've searched through the menus of insight but can't figure out how to make it talk to visualboy and vica versa. I see that there is "Target Settings" but I'm not sure what I should put in here.

Can someone please give me a straight forward step by step idiots guide to setting this debugger up? I would really appreceate it! Thanks!
_________________
- RegularKid

#18003 - yaustar - Thu Mar 18, 2004 8:54 am

see: http://forum.gbadev.org/viewtopic.php?t=2894
_________________
[Blog] [Portfolio]

#18013 - regularkid - Thu Mar 18, 2004 5:55 pm

Yeah, I have looked at that one, but it doesn't seem to be for the windows version. It says:

"i use VisualBoyAdvance & GDB, works pretty well for me, all I do is:
VisualBoyAdvance -G tcp <game>.elf

then run gdb:
gdb <game>.elf

then in gdb type:
target remote localhost:55555

and then type 'continue' to start the game running. Note, you have to use the SDL version of VisualBoyAdvance, and gdb must be compiled for ARM (put --target=arm-elf when you compile it if you compile it yourself, but there are places to download it already compiled)
Also, make sure you are running the .elf - NOT THE .BIN OR .GBA file. the .bin and .gba files have all debugging information removed. "

But when I try these commands from the dos prompt, I get an error with the first one when VBA opens saying "Unsupported file type: -G". Also, when I start insight, there is no place to just type in "target remote localhost:55555".

Has anyone got insight / vba to work together in windows? Thanks!
_________________
- RegularKid

#18017 - yaustar - Thu Mar 18, 2004 6:47 pm

It eworks fine for me on an XP machine

Points to note
1) Make sure you are using the SDL version of vba
2) Download the gdb insight from vba's website.

In insight there is a Console button...that is where you type in the 'target remote localhost:55555' bit...I can make a video / pictures of me doing and upload it tonight if that will help you.
_________________
[Blog] [Portfolio]

#18035 - regularkid - Fri Mar 19, 2004 12:42 pm

Ok, now it looks like I get the two things to talk to each other (i needed to download the SDL version of visualboy to get it to work from the command line). So, they are connected, but then when I go and hit run, the game in the window keeps going but the debugger is stuck on a breakpoint in the main entry point. Any ideas?
_________________
- RegularKid

#18037 - yaustar - Fri Mar 19, 2004 1:10 pm

Do not hit RUN
When you have connected the two together, either hit 'c' or 'continue' or type 'continue' in the console.

From there, you can hit 'F11' to jump from the emu to the debugger or it will stop on the breakpoints that you have set.

Note: if the the emu is running/playing then you will need to hit 'F11' to set breakpoints etc
_________________
[Blog] [Portfolio]

#18059 - Burre - Fri Mar 19, 2004 10:15 pm

While we are at it, does anyone know how to connect to the "regular" VBA version. I've got it to connect to Insight and download (but unfortunately I don't remember the settings), but I haven't got it start debug. It's not a big deal since the SDL version works fine, but stepping frames and breaking into GDB would be nice additional features.
_________________
"The best optimizer is between your ears..."

#18070 - yaustar - Sat Mar 20, 2004 12:55 am

I am interested in this as well since all I get is Insight freezing. I am thinking that it has to be a certain flag when loading up VBA..but not sure what
_________________
[Blog] [Portfolio]

#18496 - samhonk - Sat Mar 27, 2004 11:11 pm

Good day,

I'm a VBA newcomer, running Windows XP and VBA-SDL; using the instructions in this thread I've managed to get my program running in VBA alongside Insight, and when I press F11 in VBA it sends the SIGTRAP and returns control to me on the insight console, and all that. I can look at the registers and they seem to have what they're supposed to in 'em. So, I guess I have it working.

...now, how on earth do I get the source showing? If I go through the File | Source... menu item and select any of the .c or .s files related to the project, Insight immediately throws up an error dialog saying e.g.

Error: F:/mpwin/gba/reintr/main.c:1 Error in sourced command file:
Undefined command: "". Try "help".

Trying help, well, doesn't.

I compiled my .elf file with gcc -ggdb, so I expect that there's gdb-useable debug info around somewhere.

Anybody know how to deal with this?

Regards, Sean

#18497 - samhonk - Sat Mar 27, 2004 11:27 pm

Disregard that last - I figured it out, sorry.

Embarrassing as it is, I find that often the way to fix things is for me to post on a help forum, then go looking for the answer and voila, up it pops.

I hope that once I get rolling some I can be of assistance to others - I was a professional game programmer for 7 years and worked extensively on the old Game Boy Color. I'm not in the Business any more, but thought hobbyist GBA programming would be a hoot.

Cheers, Sean

#19810 - mr_schmoe - Sun Apr 25, 2004 10:59 pm

Quote:
...now, how on earth do I get the source showing?


Quote:
Disregard that last - I figured it out, sorry.


Alright genius, how did you figure it out.

Actually, I think I do know where my problem is. I'm not compiling my source with gcc -ggdb. When I tryed that I get all these nasty, nasty error's that I have know idea what they mean, let alone how to fix them. Is that flag essential or can I get by with out it? Well, in all honesty, I don't know if I'm as well versed in the programming world as I need to be to enter the debuggin stage. I just feel it would make things alot easier. Most of my programming experience comes from writing silly little demos in DOS with an old borland compiler and writing scripts for Microsoft Excell. Those both had debuggers built right in, I didn't have to do anything. So you can see my frustration. And sorry if I tryed to take the spot light from anyone on this post, it just seem like the most logical place to throw in my two cents (or lack the of). Thanks.

Oh and by the way, Do you want to know what I think might be an awesome project if someone is looking for a challange. Why doesn't someone make a GBA IDE with a built in debugger. Something so simple that even I can use it. Something like Visual C++ maybe?

#19812 - dagamer34 - Mon Apr 26, 2004 12:10 am

Visual HAM is probably the best IDE designed around programming for the GBA. I don't know if it will compile with DevKitAdvance, but it's basically the same compiler.

And you do NOT have to use HAMlib. I don't.
_________________
Little kids and Playstation 2's don't mix. :(

#19814 - yaustar - Mon Apr 26, 2004 12:36 am

Ah.. this topic again :)

compile like so:
Code:
cls
path=c:\DevkitAdv\old\bin\
gcc -g -o main.elf main.cpp bg.cpp -lm
objcopy -O binary main.elf rom\main.gba

pause

I think the important flag is -g

Also make sure that the elf file is in the same directory as the source files for the source to show. Put it anywhere else then you get assembly stuff I think.
_________________
[Blog] [Portfolio]