diff options
Diffstat (limited to 'gdb/compile/compile-loc2c.c')
-rw-r--r-- | gdb/compile/compile-loc2c.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c index a53214f..7ec6f67 100644 --- a/gdb/compile/compile-loc2c.c +++ b/gdb/compile/compile-loc2c.c @@ -515,15 +515,12 @@ pushf_register_address (int indent, string_file &stream, unsigned char *registers_used, struct gdbarch *gdbarch, int regnum) { - char *regname = compile_register_name_mangled (gdbarch, regnum); - struct cleanup *cleanups = make_cleanup (xfree, regname); + std::string regname = compile_register_name_mangled (gdbarch, regnum); registers_used[regnum] = 1; pushf (indent, stream, "(" GCC_UINTPTR ") &" COMPILE_I_SIMPLE_REGISTER_ARG_NAME "->%s", - regname); - - do_cleanups (cleanups); + regname.c_str ()); } /* Emit code that pushes a register's value on the stack. @@ -536,19 +533,16 @@ pushf_register (int indent, string_file &stream, unsigned char *registers_used, struct gdbarch *gdbarch, int regnum, uint64_t offset) { - char *regname = compile_register_name_mangled (gdbarch, regnum); - struct cleanup *cleanups = make_cleanup (xfree, regname); + std::string regname = compile_register_name_mangled (gdbarch, regnum); registers_used[regnum] = 1; if (offset == 0) pushf (indent, stream, COMPILE_I_SIMPLE_REGISTER_ARG_NAME "->%s", - regname); + regname.c_str ()); else pushf (indent, stream, COMPILE_I_SIMPLE_REGISTER_ARG_NAME "->%s + (" GCC_UINTPTR ") %s", - regname, hex_string (offset)); - - do_cleanups (cleanups); + regname.c_str (), hex_string (offset)); } /* Compile a DWARF expression to C code. @@ -722,6 +716,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file &stream, break; case DW_OP_addr: + uoffset = extract_unsigned_integer (op_ptr, addr_size, byte_order); op_ptr += addr_size; /* Some versions of GCC emit DW_OP_addr before DW_OP_GNU_push_tls_address. In this case the value is an |