This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] keep-variable command
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 16 Nov 2005 22:09:12 +0200
- Subject: Re: [PATCH] keep-variable command
- References: <437B44E1.8090008@st.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 16 Nov 2005 14:40:33 +0000
> From: Andrew STUBBS <andrew.stubbs@st.com>
>
> +@value{GDBN} commands that wipe the symbol table, such as @samp{file} and
> +@samp{symbol-file}, cause all convenience variables to be deleted - their
^^^
Please use "---" (3 dashes in a row) to produce a dash (as opposed to
the minus sign).
> +types are lost so their value would become meaningless. This can be avoided
> +using the @samp{keep-variable} command below.
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?
> +The next time the variable is accessed (by whatever means) @value{GDBN} will
> +attempt to find a type, in the current symbol table, with the same name as
> +the type used previously. It does not check whether the new type is in any
> +way compatible with the old type.
> +
> +If a suitable type does not exist (at the time the variable is accessed) then
> +@value{GDBN} will print a message and reset the value to @code{void}.
> +
> +If the symbol table is destroyed and recreated multiple times, the content
> +of the intermediate tables has no effect, @emph{provided that the variable
> +is not accessed while they are loaded}.
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?