* ax-gdb.c (gen_expr) <OP_REGISTER>: Error out if trying to
authorPedro Alves <palves@redhat.com>
Tue, 28 Dec 2010 17:59:58 +0000 (17:59 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 28 Dec 2010 17:59:58 +0000 (17:59 +0000)
collect a user register.

gdb/ChangeLog
gdb/ax-gdb.c

index 6508a66842e573afb9eefa226c54ec9c7c2af34f..1288db11e9a2379dc23964875568c646821ea224 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-28  Pedro Alves  <pedro@codesourcery.com>
+
+       * ax-gdb.c (gen_expr) <OP_REGISTER>: Error out if trying to
+       collect a user register.
+
 2010-12-28  Hui Zhu  <teawater@gmail.com>
 
        * gdbarch.sh (ax_pseudo_register_collect,
index ab6b82918bba1a7fe8f6302f7362ac71cd5583aa..f56183b0517160dc31b158d2fc5b51f1cb926616 100644 (file)
@@ -1978,6 +1978,12 @@ gen_expr (struct expression *exp, union exp_element **pc,
        if (reg == -1)
          internal_error (__FILE__, __LINE__,
                          _("Register $%s not available"), name);
+       /* No support for tracing user registers yet.  */
+       if (reg >= gdbarch_num_regs (exp->gdbarch)
+           + gdbarch_num_pseudo_regs (exp->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 (exp->gdbarch, reg);