This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] expected behavior for "bt" command used with "set language ..." ?
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I don't really have a strong opinion on this. But I thought I'd mention
Joel> that using a language to dump the value of a variable described using
Joel> another language can be a bit iffy, and lead to fairly mysterious
Joel> errors. If I was a fan of FUD, I might even say it can lead to crashes,
Joel> if the code is not careful enough. For instance, who knows what it's
Joel> going to look like asking Ada to print come C++ stuff, or vice-versa...
To provide some context, I've sometimes had to "set lang c" to
investigate what is really going on. I can't recall ever wanting to do
this for "bt", but certainly I've done it many times with "print".
Overall I think that gdb's model of unified types implies that languages
ought to pass whatever they don't know on to the C printers. However,
of course it's difficult to know if this really happens in all cases.
Joel> As a user, the few times I have forced the language was to execute
Joel> one command (eg: print this Ada variable using pure C), and I tend
Joel> to switch back to "auto" asap.
Yep.
Joel> That being said, it looks like this is the behavior we've had for
Joel> quite a while, now, so it confirms the current approach probably
Joel> is not that much of any issue (if at all). Hence the lack of strong
Joel> opinion :).
Joel> For now, we'll go ahead with what Tom suggests.
FWIW I also don't have a very strong opinion about this.
Tom