This is the mail archive of the
mailing list for the GDB project.
Re: [RFC/RFA] Add handling for unqualified Ada operators in linespecs
> Joel> Because the double quotes are part of the operator name... Eg:
> Joel> function "+" (A, B: My_Type) return My_Type;
> I think this could mess with the lexing plans. The original plan was
> for quotes to mean quoting. This approach means there is a situation
> where the quotes are part of the name.
> Keith... ?
If it makes thing simpler for the debugger, we could consider
the idea of accepting just + as the function name, without the quotes,
and consider the quotes as linespec quotes rather than part of
the function name. It would mean that GDB would end up accepting
the following 3 forms instead of just the first one:
But that would be OK. In Ada, '+' is really the character '+',
so it would normally make no sense in a linespec. But on the
other hand, since it makes no sense at all, we can assume that
no one in their right mind will ever use it, and if they do,
then call it a feature (because there is no other sensible thing
to do anyway).
It is worth mentioning the fact that `break +' currently assumes
that the `+' starts an offset, rather than indicates an operator
name. Surprisingly, I would have expected this to be equilvalent to
`break +0', whereas it seems to be equivalent to `break +5'!!!
Oh, not documented in the GDB manual, but seems definitely
intentional - see decode_all_digits:
if (q == *argptr)
val.line = 5;