aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-10-01 01:39:52 +0000
committerMike Frysinger <vapier@gentoo.org>2007-10-01 01:39:52 +0000
commitc4a3d09a712119df016fead2cc26dc6c0605ed2b (patch)
treebef6d583ac73aafdb1362439f4e89d4dc8fab84c /gdb/parse.c
parent9f0bdab8028f185719d163f3bfeafd1406ba5a58 (diff)
downloadgdb-c4a3d09a712119df016fead2cc26dc6c0605ed2b.zip
gdb-c4a3d09a712119df016fead2cc26dc6c0605ed2b.tar.gz
gdb-c4a3d09a712119df016fead2cc26dc6c0605ed2b.tar.bz2
2007-09-30 Mike Frysinger <vapier@gentoo.org>
* value.h (lookup_only_internalvar): New prototype. (create_internalvar): Likewise. * value.c (lookup_only_internalvar): New function. (create_internalvar): Likewise. (lookup_internalvar): Use new lookup_only_internalvar and create_internalvar functions. * parse.c (write_dollar_variable): Look up $ symbols in internal table first rather than last.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index a33a2d4..9303dfd 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -469,6 +469,7 @@ write_dollar_variable (struct stoken str)
{
struct symbol *sym = NULL;
struct minimal_symbol *msym = NULL;
+ struct internalvar *isym = NULL;
/* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
and $$digits (equivalent to $<-digits> if you could type that). */
@@ -507,6 +508,17 @@ write_dollar_variable (struct stoken str)
if (i >= 0)
goto handle_register;
+ /* Any names starting with $ are probably debugger internal variables. */
+
+ isym = lookup_only_internalvar (copy_name (str) + 1);
+ if (isym)
+ {
+ write_exp_elt_opcode (OP_INTERNALVAR);
+ write_exp_elt_intern (isym);
+ write_exp_elt_opcode (OP_INTERNALVAR);
+ return;
+ }
+
/* On some systems, such as HP-UX and hppa-linux, certain system routines
have names beginning with $ or $$. Check for those, first. */
@@ -529,10 +541,10 @@ write_dollar_variable (struct stoken str)
return;
}
- /* Any other names starting in $ are debugger internal variables. */
+ /* Any other names are assumed to be debugger internal variables. */
write_exp_elt_opcode (OP_INTERNALVAR);
- write_exp_elt_intern (lookup_internalvar (copy_name (str) + 1));
+ write_exp_elt_intern (create_internalvar (copy_name (str) + 1));
write_exp_elt_opcode (OP_INTERNALVAR);
return;
handle_last: