* dwarf2-frame.c (read_encoded_value): Add support for
DW_EH_PE_aligned encoding.
This commit is contained in:
parent
04ed252fc1
commit
68f6cf990a
@ -1,3 +1,8 @@
|
|||||||
|
2003-09-09 Mark Kettenis <kettenis@gnu.org>
|
||||||
|
|
||||||
|
* dwarf2-frame.c (read_encoded_value): Add support for
|
||||||
|
DW_EH_PE_aligned encoding.
|
||||||
|
|
||||||
2003-09-08 Daniel Jacobowitz <drow@mvista.com>
|
2003-09-08 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
* infrun.c (normal_stop): Don't print a message if the inferior
|
* infrun.c (normal_stop): Don't print a message if the inferior
|
||||||
|
@ -932,6 +932,8 @@ static CORE_ADDR
|
|||||||
read_encoded_value (struct comp_unit *unit, unsigned char encoding,
|
read_encoded_value (struct comp_unit *unit, unsigned char encoding,
|
||||||
char *buf, unsigned int *bytes_read_ptr)
|
char *buf, unsigned int *bytes_read_ptr)
|
||||||
{
|
{
|
||||||
|
int ptr_len = size_of_encoded_value (DW_EH_PE_absptr);
|
||||||
|
ptrdiff_t offset;
|
||||||
CORE_ADDR base;
|
CORE_ADDR base;
|
||||||
|
|
||||||
/* GCC currently doesn't generate DW_EH_PE_indirect encodings for
|
/* GCC currently doesn't generate DW_EH_PE_indirect encodings for
|
||||||
@ -940,6 +942,8 @@ read_encoded_value (struct comp_unit *unit, unsigned char encoding,
|
|||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
"Unsupported encoding: DW_EH_PE_indirect");
|
"Unsupported encoding: DW_EH_PE_indirect");
|
||||||
|
|
||||||
|
*bytes_read_ptr = 0;
|
||||||
|
|
||||||
switch (encoding & 0x70)
|
switch (encoding & 0x70)
|
||||||
{
|
{
|
||||||
case DW_EH_PE_absptr:
|
case DW_EH_PE_absptr:
|
||||||
@ -952,32 +956,41 @@ read_encoded_value (struct comp_unit *unit, unsigned char encoding,
|
|||||||
case DW_EH_PE_datarel:
|
case DW_EH_PE_datarel:
|
||||||
base = unit->dbase;
|
base = unit->dbase;
|
||||||
break;
|
break;
|
||||||
|
case DW_EH_PE_aligned:
|
||||||
|
base = 0;
|
||||||
|
offset = buf - unit->dwarf_frame_buffer;
|
||||||
|
if ((offset % ptr_len) != 0)
|
||||||
|
{
|
||||||
|
*bytes_read_ptr = ptr_len - (offset % ptr_len);
|
||||||
|
buf += *bytes_read_ptr;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
internal_error (__FILE__, __LINE__, "Invalid or unsupported encoding");
|
internal_error (__FILE__, __LINE__, "Invalid or unsupported encoding");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((encoding & 0x0f) == 0x00)
|
if ((encoding & 0x0f) == 0x00)
|
||||||
encoding |= encoding_for_size (TYPE_LENGTH(builtin_type_void_data_ptr));
|
encoding |= encoding_for_size (ptr_len);
|
||||||
|
|
||||||
switch (encoding & 0x0f)
|
switch (encoding & 0x0f)
|
||||||
{
|
{
|
||||||
case DW_EH_PE_udata2:
|
case DW_EH_PE_udata2:
|
||||||
*bytes_read_ptr = 2;
|
*bytes_read_ptr += 2;
|
||||||
return (base + bfd_get_16 (unit->abfd, (bfd_byte *) buf));
|
return (base + bfd_get_16 (unit->abfd, (bfd_byte *) buf));
|
||||||
case DW_EH_PE_udata4:
|
case DW_EH_PE_udata4:
|
||||||
*bytes_read_ptr = 4;
|
*bytes_read_ptr += 4;
|
||||||
return (base + bfd_get_32 (unit->abfd, (bfd_byte *) buf));
|
return (base + bfd_get_32 (unit->abfd, (bfd_byte *) buf));
|
||||||
case DW_EH_PE_udata8:
|
case DW_EH_PE_udata8:
|
||||||
*bytes_read_ptr = 8;
|
*bytes_read_ptr += 8;
|
||||||
return (base + bfd_get_64 (unit->abfd, (bfd_byte *) buf));
|
return (base + bfd_get_64 (unit->abfd, (bfd_byte *) buf));
|
||||||
case DW_EH_PE_sdata2:
|
case DW_EH_PE_sdata2:
|
||||||
*bytes_read_ptr = 2;
|
*bytes_read_ptr += 2;
|
||||||
return (base + bfd_get_signed_16 (unit->abfd, (bfd_byte *) buf));
|
return (base + bfd_get_signed_16 (unit->abfd, (bfd_byte *) buf));
|
||||||
case DW_EH_PE_sdata4:
|
case DW_EH_PE_sdata4:
|
||||||
*bytes_read_ptr = 4;
|
*bytes_read_ptr += 4;
|
||||||
return (base + bfd_get_signed_32 (unit->abfd, (bfd_byte *) buf));
|
return (base + bfd_get_signed_32 (unit->abfd, (bfd_byte *) buf));
|
||||||
case DW_EH_PE_sdata8:
|
case DW_EH_PE_sdata8:
|
||||||
*bytes_read_ptr = 8;
|
*bytes_read_ptr += 8;
|
||||||
return (base + bfd_get_signed_64 (unit->abfd, (bfd_byte *) buf));
|
return (base + bfd_get_signed_64 (unit->abfd, (bfd_byte *) buf));
|
||||||
default:
|
default:
|
||||||
internal_error (__FILE__, __LINE__, "Invalid or unsupported encoding");
|
internal_error (__FILE__, __LINE__, "Invalid or unsupported encoding");
|
||||||
|
Loading…
Reference in New Issue
Block a user