Changeset View
Changeset View
Standalone View
Standalone View
contrib/gdb/gdb/dwarf2expr.c
Show First 20 Lines • Show All 522 Lines • ▼ Show 20 Lines | switch (op) | ||||
{ | { | ||||
case DW_OP_deref: | case DW_OP_deref: | ||||
{ | { | ||||
char *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT); | char *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT); | ||||
int bytes_read; | int bytes_read; | ||||
(ctx->read_mem) (ctx->baton, buf, result, | (ctx->read_mem) (ctx->baton, buf, result, | ||||
TARGET_ADDR_BIT / TARGET_CHAR_BIT); | TARGET_ADDR_BIT / TARGET_CHAR_BIT); | ||||
result = dwarf2_read_address (buf, | result = dwarf2_read_address ((unsigned char *)buf, | ||||
buf + (TARGET_ADDR_BIT | (unsigned char*)(buf + (TARGET_ADDR_BIT | ||||
/ TARGET_CHAR_BIT), | / TARGET_CHAR_BIT)), | ||||
&bytes_read); | &bytes_read); | ||||
} | } | ||||
break; | break; | ||||
case DW_OP_deref_size: | case DW_OP_deref_size: | ||||
{ | { | ||||
char *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT); | char *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT); | ||||
int bytes_read; | int bytes_read; | ||||
(ctx->read_mem) (ctx->baton, buf, result, *op_ptr++); | (ctx->read_mem) (ctx->baton, buf, result, *op_ptr++); | ||||
result = dwarf2_read_address (buf, | result = dwarf2_read_address ((unsigned char *)buf, | ||||
buf + (TARGET_ADDR_BIT | (unsigned char *)(buf + (TARGET_ADDR_BIT | ||||
/ TARGET_CHAR_BIT), | / TARGET_CHAR_BIT)), | ||||
&bytes_read); | &bytes_read); | ||||
} | } | ||||
break; | break; | ||||
case DW_OP_abs: | case DW_OP_abs: | ||||
if ((signed int) result < 0) | if ((signed int) result < 0) | ||||
result = -result; | result = -result; | ||||
break; | break; | ||||
case DW_OP_neg: | case DW_OP_neg: | ||||
result = -result; | result = -result; | ||||
break; | break; | ||||
case DW_OP_not: | case DW_OP_not: | ||||
result = ~result; | result = ~result; | ||||
break; | break; | ||||
case DW_OP_plus_uconst: | case DW_OP_plus_uconst: | ||||
op_ptr = read_uleb128 (op_ptr, op_end, ®); | op_ptr = read_uleb128 (op_ptr, op_end, ®); | ||||
result += reg; | result += reg; | ||||
break; | |||||
default: | |||||
break; | break; | ||||
} | } | ||||
break; | break; | ||||
case DW_OP_and: | case DW_OP_and: | ||||
case DW_OP_div: | case DW_OP_div: | ||||
case DW_OP_minus: | case DW_OP_minus: | ||||
case DW_OP_mod: | case DW_OP_mod: | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |