Re: [PATCH] Disallow pseudo-registers in agent expression.

Jim Blandy
2008-02-05T15:58:57Z

I've committed the following, to fix part of this.

gdb/ChangeLog:
2008-02-05 Jim Blandy <jimb@red-bean.com>

* ax-gdb.c (gen_expr): Yield ordinary error if asked to trace a
pseudoregister, not an internal error.
Reported by: Andrzej Zaborowski

diff -r fb37ff1fb896 -r da7d103c89a5 gdb/ax-gdb.c
--- a/gdb/ax-gdb.c Tue Feb 05 07:36:35 2008 -0800
+++ b/gdb/ax-gdb.c Tue Feb 05 07:56:09 2008 -0800
@@ -1607,6 +1607,10 @@ gen_expr (union exp_element **pc, struct
if (reg == -1)
internal_error (__FILE__, __LINE__,
_("Register $%s not available"), name);
+ if (reg >= gdbarch_num_regs (current_gdbarch))
+ error (_("'%s' is a pseudo-register; "
+ "GDB cannot yet trace pseudoregister contents."),
+ name);
value->kind = axs_lvalue_register;
value->u.reg = reg;
value->type = register_type (current_gdbarch, reg);