This is the mail archive of the
mailing list for the GDB project.
Re: any expression to tell whether a variable was optimized out?
On Mar 10, 2009, Thiago Jung Bauermann <email@example.com> wrote:
> El mar, 10-03-2009 a las 08:59 -0400, Daniel Jacobowitz escribiÃ:
>> On Tue, Mar 10, 2009 at 06:48:28AM -0300, Alexandre Oliva wrote:
>> > Is there really no way to set a gdb variable to something equivalent to
>> > the boolean result of valprint.c:value_optimized_out()? Any reason for
>> > that, other than that nobody needed it before?
>> Nope, there's no way to do it. Really, unavailable ought to propogate
>> through the expression evaluator, and give errors at some points, I
> It would be easy enough to add a method to the gdb.Value Python class
> exposing this boolean. Would it help you?
Maybe. I was hoping for something already widely deployed, but
failing that, I guess it's ok to rely on future features ;-)
As for whether it would help, I can only assume it would, but I'm not
quite up to speed on how to use such Python interfaces. If the feature
can be exercised from the GDB textual interactive interface, as part of
normal expression evaluation, it will indeed help. Otherwise, I may
have to look into it further to tell whether it will help.
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer