hrev45075 adds 1 changeset to branch 'master' old head: d802af6461f3cb8d510f5e26163eeeb38fd5b44f new head: b83bece153812f214c40cdbe1932d989bef503c5 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=b83bece+%5Ed802af6 ---------------------------------------------------------------------------- b83bece: Cleanups. - Add clarifying comment. - Slightly adjust handling of augmentation 'P' so it also handles skipping LEB128-encoded values correctly. - Remove unused code. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev45075 Commit: b83bece153812f214c40cdbe1932d989bef503c5 URL: http://cgit.haiku-os.org/haiku/commit/?id=b83bece Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Mon Dec 24 05:18:38 2012 UTC ---------------------------------------------------------------------------- 1 file changed, 10 insertions(+), 24 deletions(-) src/apps/debugger/dwarf/DwarfFile.cpp | 34 +++++++++---------------------- ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/dwarf/DwarfFile.cpp b/src/apps/debugger/dwarf/DwarfFile.cpp index 7c71714..e9bb094 100644 --- a/src/apps/debugger/dwarf/DwarfFile.cpp +++ b/src/apps/debugger/dwarf/DwarfFile.cpp @@ -234,8 +234,11 @@ struct DwarfFile::CIEAugmentation { : fString(NULL), 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) @@ -270,11 +273,12 @@ struct DwarfFile::CIEAugmentation { break; case 'P': { - char personalityEncoding = dataReader.Read<char>(0); - uint8 addressSize = EncodedAddressSize( - personalityEncoding, NULL); - dataReader.Skip(addressSize); - remaining -= addressSize + 1; + char tempEncoding = fAddressEncoding; + fAddressEncoding = dataReader.Read<char>(0); + off_t offset = dataReader.Offset(); + ReadEncodedAddress(dataReader, NULL, NULL, true); + fAddressEncoding = tempEncoding; + remaining -= dataReader.Offset() - offset + 1; break; } case 'R': @@ -370,24 +374,6 @@ struct DwarfFile::CIEAugmentation { 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 { return fAddressEncoding & 0x70;