* gdb.base/attach.exp (do_attach_tests): Don't forget to kill second
[deliverable/binutils-gdb.git] / gdb / ax-gdb.c
index e38e67560f5838471e9f4575010604c5ffc2cd74..dadad8e25491a157b977a392bbc82bf494c468b0 100644 (file)
@@ -33,6 +33,8 @@
 #include "ax.h"
 #include "ax-gdb.h"
 #include "gdb_string.h"
+#include "block.h"
+#include "regcache.h"
 
 /* To make sense of this file, you should read doc/agentexpr.texi.
    Then look at the types and enums in ax-gdb.h.  For the code itself,
@@ -132,7 +134,6 @@ static void gen_sizeof (union exp_element **pc,
 static void gen_expr (union exp_element **pc,
                      struct agent_expr *ax, struct axs_value *value);
 
-static void print_axs_value (struct ui_file *f, struct axs_value * value);
 static void agent_command (char *exp, int from_tty);
 \f
 
@@ -578,7 +579,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
 
     case LOC_TYPEDEF:
       error ("Cannot compute value of typedef `%s'.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
 
     case LOC_BLOCK:
@@ -607,9 +608,9 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
     case LOC_UNRESOLVED:
       {
        struct minimal_symbol *msym
-       = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
+       = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL);
        if (!msym)
-         error ("Couldn't resolve symbol `%s'.", SYMBOL_SOURCE_NAME (var));
+         error ("Couldn't resolve symbol `%s'.", SYMBOL_PRINT_NAME (var));
 
        /* Push the address of the variable.  */
        ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym));
@@ -617,14 +618,24 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
       }
       break;
 
+    case LOC_COMPUTED:
+    case LOC_COMPUTED_ARG:
+      /* FIXME: cagney/2004-01-26: It should be possible to
+        unconditionally call the SYMBOL_OPS method when available.
+        Unfortunately DWARF 2 stores the frame-base (instead of the
+        function) location in a function's symbol.  Oops!  For the
+        moment enable this when/where applicable.  */
+      SYMBOL_OPS (var)->tracepoint_var_ref (var, ax, value);
+      break;
+
     case LOC_OPTIMIZED_OUT:
       error ("The variable `%s' has been optimized out.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
 
     default:
       error ("Cannot find value of botched symbol `%s'.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
     }
 }
@@ -1589,7 +1600,7 @@ gen_expr (union exp_element **pc, struct agent_expr *ax,
        (*pc) += 3;
        value->kind = axs_lvalue_register;
        value->u.reg = reg;
-       value->type = REGISTER_VIRTUAL_TYPE (reg);
+       value->type = register_type (current_gdbarch, reg);
       }
       break;
 
@@ -1790,33 +1801,6 @@ gen_trace_for_expr (CORE_ADDR scope, struct expression *expr)
   discard_cleanups (old_chain);
   return ax;
 }
-\f
-
-
-/* The "agent" command, for testing: compile and disassemble an expression.  */
-
-static void
-print_axs_value (struct ui_file *f, struct axs_value *value)
-{
-  switch (value->kind)
-    {
-    case axs_rvalue:
-      fputs_filtered ("rvalue", f);
-      break;
-
-    case axs_lvalue_memory:
-      fputs_filtered ("memory lvalue", f);
-      break;
-
-    case axs_lvalue_register:
-      fprintf_filtered (f, "register %d lvalue", value->u.reg);
-      break;
-    }
-
-  fputs_filtered (" : ", f);
-  type_print (value->type, "", f, -1);
-}
-
 
 static void
 agent_command (char *exp, int from_tty)
This page took 0.047475 seconds and 4 git commands to generate.