dwarf2-frame.c question for maintainers

Jim Blandy jimb@redhat.com
Fri Jul 16 21:16:00 GMT 2004


Here is a terse way to extract the least-significant end of the
register's value, regardless of endianness.

*** dwarf2-frame.c.~1.36.~	2004-06-17 16:42:41.000000000 -0500
--- dwarf2-frame.c	2004-07-16 14:57:09.000000000 -0500
*************** read_reg (void *baton, int reg)
*** 214,219 ****
--- 214,222 ----
  
    buf = (char *) alloca (register_size (gdbarch, regnum));
    frame_unwind_register (next_frame, regnum, buf);
+   store_unsigned_integer
+     (buf, TYPE_LENGTH (builtin_type_void_data_ptr),
+      extract_unsigned_integer (buf, register_size (gdbarch, regnum)));
    return extract_typed_address (buf, builtin_type_void_data_ptr);
  }

Shouldn't that work?  (Setting aside questions of whether it's
pleasing to extract, store, and then re-extract the value.)



More information about the Gdb mailing list