Question for Ada people, debugging gdb.ada/ptype_tagged_param.exp

Joel Brobecker brobecker@adacore.com
Thu Dec 12 22:48:00 GMT 2019


Hi Simon,

> >> Should we identify that the runtime is missing debug info and XFAIL
> >> the test?
> > 
> > We could do that, if you find it worth the effort.
> 
> In the spirit of reducing FAILs (a test should either PASS, XFAIL or
> KFAIL), I think it's worth the effort, I'll give it a try.  I spent
> quite a bit of time on it, so if we make it properly XFAIL, we will
> hopefully spare others some time.

OK, makes sense.

> I think we could write a "gnat_has_debug_info" proc that compiles an
> hello world program and checks for the presence of a particular symbol
> that will only be present if the runtime has debug info.  Do you have
> a suggestion of a good symbol to use here, that would allow to
> distinguish the presence and absence of debug info?

FWIW, this is really about the runtime, so I would mention it
in the name of the function.

The other thing you might want to be careful of is that, on some
platforms, the gnat runtime used for linking by default is the
shared libgnat. So, if you want to check for the presence of
a given symbol, you would have to start the program first.
Shouldn't be a big issue, I believe; you just have to run until
reaching a known subprogram in the inferior.

The approach of checking for a given symbol to infer whether
the runtime as a whole has the necessary debug info for a given
test should work in practice -- as I do not a situation where
only part of the units that need debugging info have debug info,
but not others, is worth worrying about.

Probably one good function to look for is the following:

        __gnat_debug_raise_exception

The thing with these internal functions is that they are subject
to change. We try not to, but this has happened as you can see
from the various declarations of struct exception_support_info
objects in ada-lang.c (search for default_exception_support_info).
Luckily, I think this one has been quite stable (unchanged since
March 2007 according to one of the comments0, and I am hoping
will remain the same for a veeeery long time.

Thanks for your help doing that, Simon!

-- 
Joel



More information about the Gdb-patches mailing list