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.

Beginners > failure to load .elf into VBA

#77353 - ion - Thu Mar 30, 2006 4:04 pm

Hey all,

I'm trying to load my elf file into vba_sdl for debugging but file won't load at all. here are my current specs:

vba_sdl 1.7.0
gcc 3.4.3 (devkitARM r11)
gdb 6.5.1

I've tried various version of devkitARM so I'm thinking. Is the elf botched or is it a vba issue.

I'm using eclipse as my dev environment. with vba_sdl 1.8 it loads the file but I can't debug. With 1.7 the file won't load at all.

Code:

Command Line:
------------------
vba.exe -Gtcp "${project_loc}/${project_name}.elf"

Console:
----------
VisualBoyAdvance-SDL version 1.7
Windows version
Seaching for file VisualBoyAdvance.cfg
Searching current dir: C:\Program Files\eclipse
Searching user profile directory: C:\Documents and Settings\s00003805
Searching executable directory
Reading configuration file.
Parsing debug info
Failed to load file C:\dev\main_code\project/project.elf



Any ideas? can anyone point to matching versions that work?

ION

#77433 - CyberSlag5k - Fri Mar 31, 2006 5:22 pm

Does everything compile properly or do you get any warnings? And does the file work on the emulator when you're not debugging?

I don't have much experience debugging with vba, but answering those questions might help. And if not, here's a bump for ya :).
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...

#77830 - ion - Mon Apr 03, 2006 11:11 am

sorry wasn't near the net for the weekend. well to answer some of your questions and to give you more info:

1. The .gba file loads fine but the .elf doesn't (this is from the command line).
2. The only version of VBA I can get to the load the elf is 1.8 but that doesn't debug well, only sometimes can I get past a couple of function calls.
3. I'm using lowest optimization settings with gcc.
4. There are no warnings or errors, everything compiling properly (I hate errors, I dispise warnings - bloody potential errors).
5. If i think of more I'll get back to u.

By the way how do you do debug if not with VBA? are you coding in assembly or something? VBAhelps cos I can view vram/tiles/oam so most of my errors have been sorted with that but not being able to see values in loops is annoying.

ION

#77859 - CyberSlag5k - Mon Apr 03, 2006 5:05 pm

I'm not really doing anything that warrants using an actual debugger. Just working on the basics to get my skills back up after months of neglect (hooray school). Any bugs that crop up are pretty obvious, so I don't bother with it. Back in the day I used one, but that was like 2-3 years ago, so I have no memory of what it was called.

Good luck with your project!
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...

#78177 - thegamefreak0134 - Wed Apr 05, 2006 7:53 pm

Unless I'm mistaken greatly, you have to copy the .elf file to a .bin file to get it to run. Copy the following code to the end of your batch file:

Code:
objcopy -O binary pong.elf pong.bin


and replace "pong" with the name of your .elf file. Then, load the resultant .bin file into VBA and see what happens.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#79983 - ion - Mon Apr 17, 2006 11:20 pm

hi again,

thanks for the info. indeed copying to .bin loads the file alright but is that sufficient for debugging? I thought the file needed to be in elf format to include all debugging info?

ION

#79988 - thegamefreak0134 - Mon Apr 17, 2006 11:51 pm

Well, yes it does, and no it doesn't. VBA should be able to do all of the map and OAM viewer stuff fine, but I don't believe the version you specified has a built in debugger. (for code I mean.) The closest thing I can thing of on that level is the memory viewer.

I would recommend trying an "in-between" version, as 8 is apparently buggy and 7 won't load the .elf.

Course, I've never really seen a need for a debugger, but that's just me.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#80010 - gauauu - Tue Apr 18, 2006 2:13 am

thegamefreak0134 wrote:

Course, I've never really seen a need for a debugger, but that's just me.


It's rare that you NEED a debugger, but let me tell you, there are a few times where it's much easier than alternatives (writing debugging info to the screen or a log). I do most of my debugging without one, but for those few instances when I'm really stuck, often the debugger shows me the problem within the first 3 or 4 minutes.

#80699 - ion - Mon Apr 24, 2006 10:10 pm

Thanks again guys. I've been stuck in windows lands for ages. in fact .net is my main platform and have only tackled C and GBA programming for a 4th year project... so when fooling with pointers and what not the prospect of a working debugger keeps me feelin warm. stil I've finished my project now, it's working and I'm managed to do so without a debugger. it a small project and not much dynamic stuff going on so it's been handy enough.

Cheers
ION