This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][Python] Re: any expression to tell whether a variable was optimized out?


>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:

Tom> I'm a little surprised that this is an attribute of values at all.
Tom> Doesn't that seem weird?  Is there anything useful that can be done
Tom> with a value like this?  Perhaps just fetching its type?

Thiago> I guess Alexandre just found a use for the attribute. :-)

:)

Funnily enough, a couple of PRs related to this came in over the
weekend.  And, those make it clear that we actually do want this as an
attribute of the value -- a future GCC may generate a value where some
components are defined and some are not.  In this case we would want
to track the undefined bits and let value operations apply to defined
ones but not undefined ones.  I think.

Thiago> This patch implements the attribute in gdb.Value, what do you think?

The code bits are ok.

Thiago> By the way, when writing this patch I realised that probably the
Thiago> "address" method in Value would better be turned into an attribute.

Do it :)

Thiago> Also, in the python branch, the "type" method also could be converted to
Thiago> an attribute.

The type method is still funny because, due to memory management
oddities, we always allocate a fresh Type.  This has already bit a
user, though, and we ought to figure out how to fix it.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]