forked from Imagelibrary/binutils-gdb
* dwarf2expr.h (struct dwarf_expr_context): Remove extra arguments
to read_reg and update its comment. Remove regnum member. * dwarf2expr.c (execute_stack_op): Remove memaddr and expr_lval. Don't call read_reg when setting in_reg. Call read_reg to get the frame base if it's in a register. Return the register number on the stack instead of in the context. Remove extra arguments to read_reg. * dwarf2loc.c (dwarf_expr_read_reg): Remove extra arguments. (dwarf2_evaluate_loc_desc): Call value_from_register. Expect the register number on the expression stack. (needs_frame_read_reg): Remove extra arguments.
This commit is contained in:
@@ -231,11 +231,10 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
|
||||
while (op_ptr < op_end)
|
||||
{
|
||||
enum dwarf_location_atom op = *op_ptr++;
|
||||
CORE_ADDR result, memaddr;
|
||||
CORE_ADDR result;
|
||||
ULONGEST uoffset, reg;
|
||||
LONGEST offset;
|
||||
int bytes_read;
|
||||
enum lval_type expr_lval;
|
||||
|
||||
ctx->in_reg = 0;
|
||||
|
||||
@@ -361,19 +360,8 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
|
||||
error ("DWARF-2 expression error: DW_OP_reg operations must be "
|
||||
"used alone.");
|
||||
|
||||
/* FIXME drow/2003-02-21: This call to read_reg could be pushed
|
||||
into the evaluator's caller by changing the semantics for in_reg.
|
||||
Then we wouldn't need to return an lval_type and a memaddr. */
|
||||
result = (ctx->read_reg) (ctx->baton, op - DW_OP_reg0, &expr_lval,
|
||||
&memaddr);
|
||||
|
||||
if (expr_lval == lval_register)
|
||||
{
|
||||
ctx->regnum = op - DW_OP_reg0;
|
||||
ctx->in_reg = 1;
|
||||
}
|
||||
else
|
||||
result = memaddr;
|
||||
result = op - DW_OP_reg0;
|
||||
ctx->in_reg = 1;
|
||||
|
||||
break;
|
||||
|
||||
@@ -383,16 +371,8 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
|
||||
error ("DWARF-2 expression error: DW_OP_reg operations must be "
|
||||
"used alone.");
|
||||
|
||||
result = (ctx->read_reg) (ctx->baton, reg, &expr_lval, &memaddr);
|
||||
|
||||
if (expr_lval == lval_register)
|
||||
{
|
||||
ctx->regnum = reg;
|
||||
ctx->in_reg = 1;
|
||||
}
|
||||
else
|
||||
result = memaddr;
|
||||
|
||||
result = reg;
|
||||
ctx->in_reg = 1;
|
||||
break;
|
||||
|
||||
case DW_OP_breg0:
|
||||
@@ -429,8 +409,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
|
||||
case DW_OP_breg31:
|
||||
{
|
||||
op_ptr = read_sleb128 (op_ptr, op_end, &offset);
|
||||
result = (ctx->read_reg) (ctx->baton, op - DW_OP_breg0,
|
||||
&expr_lval, &memaddr);
|
||||
result = (ctx->read_reg) (ctx->baton, op - DW_OP_breg0);
|
||||
result += offset;
|
||||
}
|
||||
break;
|
||||
@@ -438,7 +417,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
|
||||
{
|
||||
op_ptr = read_uleb128 (op_ptr, op_end, ®);
|
||||
op_ptr = read_sleb128 (op_ptr, op_end, &offset);
|
||||
result = (ctx->read_reg) (ctx->baton, reg, &expr_lval, &memaddr);
|
||||
result = (ctx->read_reg) (ctx->baton, reg);
|
||||
result += offset;
|
||||
}
|
||||
break;
|
||||
@@ -460,7 +439,9 @@ execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr,
|
||||
(ctx->get_frame_base) (ctx->baton, &datastart, &datalen);
|
||||
dwarf_expr_eval (ctx, datastart, datalen);
|
||||
result = dwarf_expr_fetch (ctx, 0);
|
||||
if (! ctx->in_reg)
|
||||
if (ctx->in_reg)
|
||||
result = (ctx->read_reg) (ctx->baton, result);
|
||||
else
|
||||
{
|
||||
char *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT);
|
||||
int bytes_read;
|
||||
|
||||
Reference in New Issue
Block a user