Cleanups.
- Add clarifying comment. - Slightly adjust handling of augmentation 'P' so it also handles skipping LEB128-encoded values correctly. - Remove unused code.
This commit is contained in:
@@ -234,8 +234,11 @@ struct DwarfFile::CIEAugmentation {
|
|||||||
:
|
:
|
||||||
fString(NULL),
|
fString(NULL),
|
||||||
fFlags(0),
|
fFlags(0),
|
||||||
fAddressEncoding(0)
|
fAddressEncoding(CFI_ADDRESS_FORMAT_ABSOLUTE)
|
||||||
{
|
{
|
||||||
|
// we default to absolute address format since that corresponds
|
||||||
|
// to the DWARF standard for .debug_frame. In gcc's case, however,
|
||||||
|
// .eh_frame will generally override that via augmentation 'R'
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init(DataReader& dataReader)
|
void Init(DataReader& dataReader)
|
||||||
@@ -270,11 +273,12 @@ struct DwarfFile::CIEAugmentation {
|
|||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
{
|
{
|
||||||
char personalityEncoding = dataReader.Read<char>(0);
|
char tempEncoding = fAddressEncoding;
|
||||||
uint8 addressSize = EncodedAddressSize(
|
fAddressEncoding = dataReader.Read<char>(0);
|
||||||
personalityEncoding, NULL);
|
off_t offset = dataReader.Offset();
|
||||||
dataReader.Skip(addressSize);
|
ReadEncodedAddress(dataReader, NULL, NULL, true);
|
||||||
remaining -= addressSize + 1;
|
fAddressEncoding = tempEncoding;
|
||||||
|
remaining -= dataReader.Offset() - offset + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'R':
|
case 'R':
|
||||||
@@ -370,24 +374,6 @@ struct DwarfFile::CIEAugmentation {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 EncodedAddressSize(char encoding, CompilationUnit* unit) const
|
|
||||||
{
|
|
||||||
switch (encoding & 0x07) {
|
|
||||||
case CFI_ADDRESS_FORMAT_ABSOLUTE:
|
|
||||||
return unit->AddressSize();
|
|
||||||
case CFI_ADDRESS_FORMAT_UNSIGNED_16:
|
|
||||||
return 2;
|
|
||||||
case CFI_ADDRESS_FORMAT_UNSIGNED_32:
|
|
||||||
return 4;
|
|
||||||
case CFI_ADDRESS_FORMAT_UNSIGNED_64:
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: gcc doesn't (currently) actually generate LEB128-formatted
|
|
||||||
// addresses. If that changes, we'll need to handle them accordingly
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8 FDEAddressType() const
|
uint8 FDEAddressType() const
|
||||||
{
|
{
|
||||||
return fAddressEncoding & 0x70;
|
return fAddressEncoding & 0x70;
|
||||||
|
|||||||
Reference in New Issue
Block a user