views:

57

answers:

1

I'm on an XP Virtual Machine running the GNU Visual Debugger 1.2.6, trying to open an Ada file (.adb), but keep getting the following error:

not in executable format: File format not recognized

I should also mention that I've installed both the Ada compiler kit and win32 tools for GNAT 3.14p.

I've since tried opening other .adb files from the GVD and even .c files, but all with the same happy response above.

Any idea why this is happening?

+3  A: 

GVD does not take a source file as an argument, it takes an executable program. Skipping a lot of if this and if that, to debug foo.adb you probably want to pass foo.exe to the debugger.

But this is Ada, and you shouldn't be here. ;-) If you got your source program to compile and produce an executable, you very seldom need to run the debugger. I can remember the last time I used the debugger with GNAT, and why. (A bug in Solaris, the workaround was change a constant to a variable--Solaris was overwriting the value passed in instead of using a temp.) But that was what? Five years ago?

It is much easier to put in some debugging code (see pragma Debug in the GNAT documentation), then run the program with the debug flag if necessary.

Oh, most important. You may need to look in C:\GNAT\2010\share\doc\ to find all the documentation that came with GNAT. Read it. Or at least figure out how to search it for what you need. ;-)

Robert I. Eachus
Excellent. I was starting to suspect it didn't want source at all. I'll check into the pragma Debug as well. I ended up running to the command line to compile anyway.
Old McStopher
lol. Nice thought, but I can vouch that a good debugger is quite handy, even with Ada code. You don't have to live your life in the debugger, like you do with C code, but it can be very helpful.
T.E.D.