* sparc64-tdep.h (stryct_frame_info, struct trad_frame_saved_reg):
[deliverable/binutils-gdb.git] / gdb / dwarf2expr.c
index 410cd54c6227f198cb5c8a771d0958461dd13553..50baced5f2e8d1c4ef232be52cb6633d55180cd3 100644 (file)
@@ -178,7 +178,9 @@ dwarf2_read_address (unsigned char *buf, unsigned char *buf_end, int *bytes_read
     error ("dwarf2_read_address: Corrupted DWARF expression.");
 
   *bytes_read = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
-  result = extract_address (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+  /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2
+     address is always unsigned.  That may or may not be true.  */
+  result = extract_unsigned_integer (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
   return result;
 }
 
@@ -439,18 +441,6 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
            result = dwarf_expr_fetch (ctx, 0);
            if (ctx->in_reg)
              result = (ctx->read_reg) (ctx->baton, result);
-           else
-             {
-               char *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT);
-               int bytes_read;
-
-               (ctx->read_mem) (ctx->baton, buf, result,
-                                TARGET_ADDR_BIT / TARGET_CHAR_BIT);
-               result = dwarf2_read_address (buf,
-                                             buf + (TARGET_ADDR_BIT
-                                                    / TARGET_CHAR_BIT),
-                                             &bytes_read);
-             }
            result = result + offset;
            ctx->stack_len = before_stack_len;
            ctx->in_reg = 0;
@@ -572,7 +562,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
            second = dwarf_expr_fetch (ctx, 0);
            dwarf_expr_pop (ctx);
 
-           first = dwarf_expr_fetch (ctx, 1);
+           first = dwarf_expr_fetch (ctx, 0);
            dwarf_expr_pop (ctx);
 
            val1 = value_from_longest (unsigned_address_type (), first);
@@ -639,6 +629,14 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
          break;
 
        case DW_OP_GNU_push_tls_address:
+         /* Variable is at a constant offset in the thread-local
+         storage block into the objfile for the current thread and
+         the dynamic linker module containing this expression. Here
+         we return returns the offset from that base.  The top of the
+         stack has the offset from the beginning of the thread
+         control block at which the variable is located.  Nothing
+         should follow this operator, so the top of stack would be
+         returned.  */
          result = dwarf_expr_fetch (ctx, 0);
          dwarf_expr_pop (ctx);
          result = (ctx->get_tls_address) (ctx->baton, result);
@@ -662,7 +660,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
          goto no_push;
 
        default:
-         error ("Unhandled dwarf expression opcode");
+         error ("Unhandled dwarf expression opcode 0x%x", op);
        }
 
       /* Most things push a result value.  */
This page took 0.02606 seconds and 4 git commands to generate.