Breakpad DWARF: Add support for DWARF 4 attribute forms.

This patch allows Breakpad's DWARF reader to at least read or skip
attributes using the new forms defined in version 4 of the DWARF
specification, instead of crashing.

Attributes encoded using DW_FORM_flag_present, DW_FORM_sec_offset, and
DW_FORM_exprloc should work fine now. However, compilation units using
DW_FORM_ref_sig8 to refer to types in .debug_types will need further work
to support. (GCC 4.6.2 does not emit .debug_types sections.)

Specifically:

- dwarf2reader::DwarfForm gets new values.
- dwarf2reader::Dwarf2Handler and dwarf2reader::DIEHandler get new handler
  methods, named ProcessAttributeSignature, for DW_FORM_ref_sig8 attributes.
- dwarf2reader::CompilationUnit reads DW_FORM_ref_sig8 attributes, and
  passes them to ProcessAttributeSignature. It also gets support for
  DW_FORM_sec_offset, DW_FORM_exprloc, and DW_FORM_flag_present, using the
  existing appropriate ProcessAttribute* methods.
- dwarf2reader::DIEDispatcher passes through ProcessAttributeSignature
  attributes to its DIEHandler.
- Unit tests are updated.

a=jimb, r=ted.mielczarek
Review URL: http://breakpad.appspot.com/343003/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@912 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
jimblandy
2012-02-01 15:01:54 +00:00
parent 08b912f1ed
commit 5e4f6feaf6
7 changed files with 179 additions and 8 deletions

View File

@@ -209,6 +209,9 @@ class DIEHandler {
virtual void ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
const std::string& data) { }
virtual void ProcessAttributeSignature(enum DwarfAttribute attr,
enum DwarfForm form,
uint64 signture) { }
// Once we have reported all the DIE's attributes' values, we call
// this member function. If it returns false, we skip all the DIE's
@@ -314,6 +317,10 @@ class DIEDispatcher: public Dwarf2Handler {
enum DwarfAttribute attr,
enum DwarfForm form,
const std::string &data);
void ProcessAttributeSignature(uint64 offset,
enum DwarfAttribute attr,
enum DwarfForm form,
uint64 signature);
void EndDIE(uint64 offset);
private: