[PATCH] keeping convenience variables (take 2)

Andrew STUBBS andrew.stubbs@st.com
Mon Nov 21 22:05:00 GMT 2005


Hi all,

Attached is a new attempt at keeping convenience variables over 
symbol-file commands.

This time the 'keep-variable' command has been ditched in favour of 
always attempting to keep all variables.

Additionally, it no longer throws away the value if it cannot find a 
suitable type. Instead it keeps the value stored away and reinstates it 
if a suitable type reappears at some point in the future. Note that here 
'suitable' means 'has the same name' - it does not try to check if the 
types are in any way compatible.

While the type does not exist, the value is 'void'. 'show convenience' 
will annotate this value with '<type 'whatever' unknown>'. I would 
prefer that this were the case when the value is printed with 'print' 
also, but that would require changing all language val_print functions 
(???) and need some sort of scheme for passing the information to those 
functions (they only see the type and the raw contents, not the struct 
value).

If this sort of annotation is appropriate I would do something similar 
for endian-challenged variables.

When it does not find a type, parse_expression() prints a diagnostic 
message. If possible I would like to suppress this, but I am not sure 
what the best approach to this might be. Any suggestions?

Note that this patch is intended to be applied on top of my endian fixup 
patch posted recently.

Thanks

Andrew Stubbs
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: keepvariable-2.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20051121/26f6c83a/attachment.ksh>


More information about the Gdb-patches mailing list