Add parsing for several new attribute classes.

- Collectively the previous set of changes get us minimally parsing
some of the new DWARF4 output from gcc 4.7 as well as some of the
draft DWARF5 extensions, which allows us to handle such executables
a bit more gracefully. Not all of the new information is made use of
as yet though. Should resolve #9799.
This commit is contained in:
Rene Gollent 2013-05-28 22:31:54 -04:00
parent 54a0525eca
commit 2f6ecd577a
1 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2012, Rene Gollent, rene@gollent.com.
* Copyright 2012-2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
@ -1253,7 +1253,17 @@ DwarfFile::_ParseEntryAttributes(DataReader& dataReader,
case DW_FORM_ref_udata:
value = dataReader.ReadUnsignedLEB128(0);
break;
case DW_FORM_exprloc:
value = dataReader.ReadUnsignedLEB128(0);
break;
case DW_FORM_flag_present:
attributeValue.SetToFlag(dataReader.Read<uint8>(0) != 0);
break;
case DW_FORM_ref_sig8:
value = dataReader.Read<uint64>(0);
break;
case DW_FORM_indirect:
case DW_FORM_sec_offset:
default:
WARNING("Unsupported attribute form: %" B_PRIu32 "\n",
attributeForm);
@ -1322,6 +1332,10 @@ DwarfFile::_ParseEntryAttributes(DataReader& dataReader,
case ATTRIBUTE_CLASS_STRING:
// already set
break;
case ATTRIBUTE_CLASS_EXPRESSION:
// TODO: implement
dataReader.Skip(value);
break;
}
if (dataReader.HasOverflow()) {