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: [PATCH] keep-variable command


Eli Zaretskii wrote:
It's possible this is something I never knew about: is it actually
correct that _all_ convenience variables are deleted when `file' is
used?  The explanation above about their types being lost doesn't make
sense to me; can you explain?  For example, if I define a variable
that holds an integer number, why would its type become meaningless?

Currently _all_ convenience variables are deleted when the symbol-file command is used. The file command also uses symbol-file.


The explanation I gave refers to the situation after my patch has been applied and the debugger is attempting to keep some variables. You are correct when you say that basic types will always exist. However, I did not want to assume that they will be kept in the same place. Our initial implementation did not attempt to fix this up at all and worked for quite a while before anybody noticed it didn't work (badly) with unusual types. Investigation showed that it was only working with basic types by chance - the new types just happened to be at the same addresses, so I fixed it up properly as you see it now. There is always the possibility of a file redefining any type, of course, so you may not be using the int you thought you were using.

Does this description assume that convenience variables point, or are
somehow related, to the symbol table?  If so, why does this assumption
hold for every convenience variable?  I can think of a convenience
variable that has no relation whatsoever to the symbol table; how does
such a variable fit into the above scheme?

All variables must have a type, even void ones, as far as I can tell. The type is recorded in terms of a reference into a table of types which is related to the symbol table in some way I do not claim to fully understand. What is certain is that symbol-file wipes the type table.


Please give your example of a convenience variable with no relation to the symbol table.

Andrew


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