diff options
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r-- | gdb/dwarf2expr.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index fe0fd83..a9691bd 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -207,6 +207,7 @@ CORE_ADDR dwarf2_read_address (struct gdbarch *gdbarch, gdb_byte *buf, gdb_byte *buf_end, int addr_size) { + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR result; if (buf_end - buf < addr_size) @@ -227,7 +228,7 @@ dwarf2_read_address (struct gdbarch *gdbarch, gdb_byte *buf, return gdbarch_integer_to_address (gdbarch, unsigned_address_type (gdbarch, addr_size), buf); - return extract_unsigned_integer (buf, addr_size); + return extract_unsigned_integer (buf, addr_size, byte_order); } /* Return the type of an address of size ADDR_SIZE, @@ -277,6 +278,8 @@ static void execute_stack_op (struct dwarf_expr_context *ctx, gdb_byte *op_ptr, gdb_byte *op_end) { + enum bfd_endian byte_order = gdbarch_byte_order (ctx->gdbarch); + ctx->in_reg = 0; ctx->initialized = 1; /* Default is initialized. */ @@ -336,35 +339,35 @@ execute_stack_op (struct dwarf_expr_context *ctx, break; case DW_OP_const1u: - result = extract_unsigned_integer (op_ptr, 1); + result = extract_unsigned_integer (op_ptr, 1, byte_order); op_ptr += 1; break; case DW_OP_const1s: - result = extract_signed_integer (op_ptr, 1); + result = extract_signed_integer (op_ptr, 1, byte_order); op_ptr += 1; break; case DW_OP_const2u: - result = extract_unsigned_integer (op_ptr, 2); + result = extract_unsigned_integer (op_ptr, 2, byte_order); op_ptr += 2; break; case DW_OP_const2s: - result = extract_signed_integer (op_ptr, 2); + result = extract_signed_integer (op_ptr, 2, byte_order); op_ptr += 2; break; case DW_OP_const4u: - result = extract_unsigned_integer (op_ptr, 4); + result = extract_unsigned_integer (op_ptr, 4, byte_order); op_ptr += 4; break; case DW_OP_const4s: - result = extract_signed_integer (op_ptr, 4); + result = extract_signed_integer (op_ptr, 4, byte_order); op_ptr += 4; break; case DW_OP_const8u: - result = extract_unsigned_integer (op_ptr, 8); + result = extract_unsigned_integer (op_ptr, 8, byte_order); op_ptr += 8; break; case DW_OP_const8s: - result = extract_signed_integer (op_ptr, 8); + result = extract_signed_integer (op_ptr, 8, byte_order); op_ptr += 8; break; case DW_OP_constu: @@ -712,13 +715,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, break; case DW_OP_skip: - offset = extract_signed_integer (op_ptr, 2); + offset = extract_signed_integer (op_ptr, 2, byte_order); op_ptr += 2; op_ptr += offset; goto no_push; case DW_OP_bra: - offset = extract_signed_integer (op_ptr, 2); + offset = extract_signed_integer (op_ptr, 2, byte_order); op_ptr += 2; if (dwarf_expr_fetch (ctx, 0) != 0) op_ptr += offset; |