This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dwarf2-frame.c question for maintainers


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.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]