Reputation: 16211
I have an Ada application (GHDL) compiled in MinGW32 (gcc-ada). I would like to debug it in gdb, but gdb reports that the Ada runtime has no debug information, so I can't catch exceptions:
(gdb) catch exception
Your Ada runtime appears to be missing some debugging information.
Cannot insert Ada exception catchpoint in this configuration.
(gdb)
Is there a way to extend the Ada runtime with debug information?
Upvotes: 2
Views: 521
Reputation: 25491
You may have come across an issue to do with the way GDB reads Ada-related symbols (bug 11385, cannot catch Ada exceptions).
The fix I use is to use -readnow
:
gdb -readnow {executable}
I don’t know about MinGW32, but I believe that if you include -g
in your GPR file,
package Builder is
for Default_Switches ("ada") use (“-g”);
end Builder;
the program is linked against the static version of the RTS, which includes debug symbols.
Upvotes: 1
Reputation:
If you are building ghdl from source - with the gcc backend - you can easily also build Gnat, simply by adding ada in the --enable-languages=c,c++,ada,vhdl
configure option.
Then if you're not too worried about performance, you can add the -g
flag to Make, and build the lot (gcc, Gnat and ghdl) with debugging information, and that will include the Ada RTS. If you then use this compiler and its RTS to re-build ghdl, then you should have a debuggable ghdl compiler - barring any gnarly problems building for mingw32.
I cannot comment on possible mingw problems, beyond suggesting, should there be any, you might be better debugging on another platform - unless it is specifically a mingw problem you are chasing. I have used the mingw compilers on Debian, to cross-compile Ada programs which run fine on Windows, but I haven't tried to bootstrap either Gnat or ghdl that way.
Upvotes: 1
Reputation: 6601
You would have to install a version of the run-time library, which included debugging information. (I don't know enough about Windows and MinGW32 to give you more specific help.)
Upvotes: 1