Do not load .eh_frame section from separete object files
[deliverable/binutils-gdb.git] / gdb / ax-gdb.c
index 8094710c32580a78e652ed139f0e2d420af7c2e9..5258167df3824a9ce0e836b03e03820bbfd1b424 100644 (file)
@@ -1094,8 +1094,9 @@ gen_ptrdiff (struct agent_expr *ax, struct axs_value *value,
 
   if (TYPE_LENGTH (TYPE_TARGET_TYPE (value1->type))
       != TYPE_LENGTH (TYPE_TARGET_TYPE (value2->type)))
-    error (_("First argument of `-' is a pointer, but second argument "
-            "is neither\nan integer nor a pointer of the same type."));
+    error (_("\
+First argument of `-' is a pointer, but second argument is neither\n\
+an integer nor a pointer of the same type."));
 
   ax_simple (ax, aop_sub);
   gen_scale (ax, aop_div_unsigned, value1->type);
@@ -1548,7 +1549,7 @@ gen_static_field (struct gdbarch *gdbarch,
     }
   else
     {
-      char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
+      const char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
       struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0);
 
       if (sym)
@@ -2043,14 +2044,13 @@ gen_expr (struct expression *exp, union exp_element **pc,
 
        (*pc) += 3;
        gen_expr (exp, pc, ax, value);
-       /* I'm not sure I understand UNOP_MEMVAL entirely.  I think
-          it's just a hack for dealing with minsyms; you take some
-          integer constant, pretend it's the address of an lvalue of
-          the given type, and dereference it.  */
-       if (value->kind != axs_rvalue)
-         /* This would be weird.  */
-         internal_error (__FILE__, __LINE__,
-                         _("gen_expr: OP_MEMVAL operand isn't an rvalue???"));
+
+       /* If we have an axs_rvalue or an axs_lvalue_memory, then we
+          already have the right value on the stack.  For
+          axs_lvalue_register, we must convert.  */
+       if (value->kind == axs_lvalue_register)
+         require_rvalue (ax, value);
+
        value->type = type;
        value->kind = axs_lvalue_memory;
       }
@@ -2138,18 +2138,17 @@ gen_expr (struct expression *exp, union exp_element **pc,
     case OP_THIS:
       {
        char *this_name;
-       struct symbol *func, *sym;
+       struct symbol *sym, *func;
        struct block *b;
+       const struct language_defn *lang;
 
-       func = block_linkage_function (block_for_pc (ax->scope));
-       this_name = language_def (SYMBOL_LANGUAGE (func))->la_name_of_this;
-       b = SYMBOL_BLOCK_VALUE (func);
+       b = block_for_pc (ax->scope);
+       func = block_linkage_function (b);
+       lang = language_def (SYMBOL_LANGUAGE (func));
 
-       /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
-          symbol instead of the LOC_ARG one (if both exist).  */
-       sym = lookup_block_symbol (b, this_name, VAR_DOMAIN);
+       sym = lookup_language_this (lang, b);
        if (!sym)
-         error (_("no `%s' found"), this_name);
+         error (_("no `%s' found"), lang->la_name_of_this);
 
        gen_var_ref (exp->gdbarch, ax, value, sym);
 
This page took 0.02573 seconds and 4 git commands to generate.