+2014-09-12 Petr Machata <pmachata@redhat.com>
+
+ * memory-access.h (read_ubyte_unaligned_inc): Allow only 4- and
+ 8-byte quantities. Consequently, rename to...
+ (read_addr_unaligned_inc): ... this.
+ (read_sbyte_unaligned_inc, read_ubyte_unaligned): Drop.
+ (read_sbyte_unaligned): Drop.
+
2014-09-10 Petr Machata <pmachata@redhat.com>
* dwarf_getlocation.c (attr_ok): Also accept
#endif /* allow unaligned */
-#define read_ubyte_unaligned(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2ubyte_unaligned (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4ubyte_unaligned (Dbg, Addr) \
- : read_8ubyte_unaligned (Dbg, Addr))
-
-#define read_sbyte_unaligned(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2sbyte_unaligned (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4sbyte_unaligned (Dbg, Addr) \
- : read_8sbyte_unaligned (Dbg, Addr))
-
-
#define read_2ubyte_unaligned_inc(Dbg, Addr) \
({ uint16_t t_ = read_2ubyte_unaligned (Dbg, Addr); \
Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 2); \
t_; })
-#define read_ubyte_unaligned_inc(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2ubyte_unaligned_inc (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \
- : read_8ubyte_unaligned_inc (Dbg, Addr))
-
-#define read_sbyte_unaligned_inc(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2sbyte_unaligned_inc (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4sbyte_unaligned_inc (Dbg, Addr) \
- : read_8sbyte_unaligned_inc (Dbg, Addr))
+#define read_addr_unaligned_inc(Nbytes, Dbg, Addr) \
+ (assert ((Nbytes) == 4 || (Nbytes) == 8), \
+ ((Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \
+ : read_8ubyte_unaligned_inc (Dbg, Addr)))
#endif /* memory-access.h */
+2014-09-12 Petr Machata <pmachata@redhat.com>
+
+ * readelf.c (encoded_ptr_size): In the switch statement, change
+ magic constants 3 and 4 to DW_EH_PE_* counterparts. Still accept
+ 0. Print diagnostic for anything else.
+
2014-08-25 Josh Stone <jistone@redhat.com>
* Makefile.am: Prevent premature @AR@ replacement in a sed expression.
{
switch (encoding & 7)
{
- case 2:
- return 2;
- case 3:
+ case DW_EH_PE_udata4:
return 4;
- case 4:
+ case DW_EH_PE_udata8:
return 8;
- default:
+ case 0:
return ptr_size;
}
+
+ fprintf (stderr, "Unsupported pointer encoding: %#x, "
+ "assuming pointer size of %d.\n", encoding, ptr_size);
+ return ptr_size;
}
const unsigned char *base = readp;
// XXX There are sometimes relocations for this value
- initial_location = read_ubyte_unaligned_inc (ptr_size, dbg, readp);
+ initial_location = read_addr_unaligned_inc (ptr_size, dbg, readp);
Dwarf_Word address_range
- = read_ubyte_unaligned_inc (ptr_size, dbg, readp);
+ = read_addr_unaligned_inc (ptr_size, dbg, readp);
/* pcrel for an FDE address is relative to the runtime
address of the start_address field itself. Sign extend