aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf_cu_to_module.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/dwarf_cu_to_module.h')
-rw-r--r--src/common/dwarf_cu_to_module.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h
index a36b82b0..c1135dd0 100644
--- a/src/common/dwarf_cu_to_module.h
+++ b/src/common/dwarf_cu_to_module.h
@@ -123,6 +123,22 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
scoped_ptr<FilePrivate> file_private_;
};
+ // An abstract base class for handlers that handle DWARF range lists for
+ // DwarfCUToModule.
+ class RangesHandler {
+ public:
+ RangesHandler() { }
+ virtual ~RangesHandler() { }
+
+ // Called when finishing a function to populate the function's ranges.
+ // The ranges' entries are read starting from offset in the .debug_ranges
+ // section, base_address holds the base PC the range list values are
+ // offsets off. Return false if the rangelist falls out of the
+ // .debug_ranges section.
+ virtual bool ReadRanges(uint64 offset, Module::Address base_address,
+ vector<Module::Range>* ranges) = 0;
+ };
+
// An abstract base class for handlers that handle DWARF line data
// for DwarfCUToModule. DwarfCUToModule could certainly just use
// dwarf2reader::LineInfo itself directly, but decoupling things
@@ -208,6 +224,14 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// FilePrivate did not retain the inter-CU specification data.
virtual void UnhandledInterCUReference(uint64 offset, uint64 target);
+ // The DW_AT_ranges at offset is malformed (truncated or outside of the
+ // .debug_ranges section's bound).
+ virtual void MalformedRangeList(uint64 offset);
+
+ // A DW_AT_ranges attribute was encountered but the no .debug_ranges
+ // section was found.
+ virtual void MissingRanges();
+
uint64 cu_offset() const {
return cu_offset_;
}
@@ -235,6 +259,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// data we find.
DwarfCUToModule(FileContext *file_context,
LineToModuleHandler *line_reader,
+ RangesHandler *ranges_handler,
WarningReporter *reporter);
~DwarfCUToModule();
@@ -296,6 +321,9 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// The handler to use to handle line number data.
LineToModuleHandler *line_reader_;
+ // The handler to use to handle range lists.
+ RangesHandler *ranges_handler_;
+
// This compilation unit's context.
scoped_ptr<CUContext> cu_context_;