[3/4] GDB: Add support for 24 bit addresses
Commit Message
* gdb/dwarf2-frame.c (encoding_for_size): Deal with case 3.
(read_encoded_value): Deal with case DW_EH_PE_udata3
---
gdb/dwarf2-frame.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Comments
>>>>> "John" == John Darrington <john@darrington.wattle.id.au> writes:
John> * gdb/dwarf2-frame.c (encoding_for_size): Deal with case 3.
John> (read_encoded_value): Deal with case DW_EH_PE_udata3
This is ok; pending the dwarf2.h patch of course.
John> default:
John> - internal_error (__FILE__, __LINE__, _("Unsupported address size"));
John> + internal_error (__FILE__, __LINE__, _("Unsupported address size %d"), size);
Thanks for doing that.
Tom
@@ -1527,12 +1527,14 @@ encoding_for_size (unsigned int size)
{
case 2:
return DW_EH_PE_udata2;
+ case 3:
+ return DW_EH_PE_udata3;
case 4:
return DW_EH_PE_udata4;
case 8:
return DW_EH_PE_udata8;
default:
- internal_error (__FILE__, __LINE__, _("Unsupported address size"));
+ internal_error (__FILE__, __LINE__, _("Unsupported address size %d"), size);
}
}
@@ -1605,6 +1607,9 @@ read_encoded_value (struct comp_unit *unit, gdb_byte encoding,
case DW_EH_PE_udata2:
*bytes_read_ptr += 2;
return (base + bfd_get_16 (unit->abfd, (bfd_byte *) buf));
+ case DW_EH_PE_udata3:
+ *bytes_read_ptr += 3;
+ return (base + bfd_get_24 (unit->abfd, (bfd_byte *) buf));
case DW_EH_PE_udata4:
*bytes_read_ptr += 4;
return (base + bfd_get_32 (unit->abfd, (bfd_byte *) buf));