mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-04 13:44:33 +01:00
Breakpad: Add minidump processor support for DWARF Call Frame Information.
Add a CFIFrameInfo class (named for symmetry with WindowsFrameInfo) to represent the set of STACK CFI rules in effect at a given instruction, and apply them to a set of register values. Provide a SimpleCFIWalker class template, to allow the essential CFI code to be shared amongst the different architectures. Teach BasicSourceLineResolver to partially parse 'STACK CFI' records, and produce the set of rules in effect at a given instruction on demand, by combining the initial rule set and the appropriate rule deltas in a CFIFrameInfo object. Adapt StackwalkerX86 and StackFrameX86 to retrieve, store, and apply CFI stack walking information. Add validity flags for all the general-purpose registers to StackFrameX86::ContextValidity. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@549 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
a7eb2329de
commit
6d3a825dbf
16 changed files with 1850 additions and 46 deletions
|
|
@ -60,12 +60,10 @@ class BasicSourceLineResolver : public SourceLineResolverInterface {
|
|||
virtual bool LoadModuleUsingMapBuffer(const string &module_name,
|
||||
const string &map_buffer);
|
||||
|
||||
|
||||
virtual bool HasModule(const string &module_name) const;
|
||||
|
||||
virtual void FillSourceLineInfo(StackFrame *frame) const;
|
||||
|
||||
virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) const;
|
||||
virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const;
|
||||
|
||||
private:
|
||||
template<class T> class MemAddrMap;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ using std::string;
|
|||
|
||||
struct StackFrame;
|
||||
struct WindowsFrameInfo;
|
||||
struct CFIFrameInfo;
|
||||
|
||||
class SourceLineResolverInterface {
|
||||
public:
|
||||
|
|
@ -78,6 +79,12 @@ class SourceLineResolverInterface {
|
|||
virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame)
|
||||
const = 0;
|
||||
|
||||
// If CFI stack walking information is available covering ADDRESS,
|
||||
// return a CFIFrameInfo structure describing it. If the information
|
||||
// is not available, return NULL. The caller takes ownership of any
|
||||
// returned CFIFrameInfo object.
|
||||
virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const = 0;
|
||||
|
||||
protected:
|
||||
// SourceLineResolverInterface cannot be instantiated except by subclasses
|
||||
SourceLineResolverInterface() {}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// -*- mode: c++ -*-
|
||||
|
||||
// Copyright (c) 2010 Google Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
|
|
@ -45,18 +47,26 @@
|
|||
namespace google_breakpad {
|
||||
|
||||
struct WindowsFrameInfo;
|
||||
struct CFIFrameInfo;
|
||||
|
||||
struct StackFrameX86 : public StackFrame {
|
||||
// ContextValidity has one entry for each relevant hardware pointer register
|
||||
// (%eip and %esp) and one entry for each nonvolatile (callee-save) register.
|
||||
// ContextValidity has one entry for each relevant hardware pointer
|
||||
// register (%eip and %esp) and one entry for each general-purpose
|
||||
// register. It's worthwhile having validity flags for caller-saves
|
||||
// registers: they are valid in the youngest frame, and such a frame
|
||||
// might save a callee-saves register in a caller-saves register, but
|
||||
// SimpleCFIWalker won't touch registers unless they're marked as valid.
|
||||
enum ContextValidity {
|
||||
CONTEXT_VALID_NONE = 0,
|
||||
CONTEXT_VALID_EIP = 1 << 0,
|
||||
CONTEXT_VALID_ESP = 1 << 1,
|
||||
CONTEXT_VALID_EBP = 1 << 2,
|
||||
CONTEXT_VALID_EBX = 1 << 3,
|
||||
CONTEXT_VALID_ESI = 1 << 4,
|
||||
CONTEXT_VALID_EDI = 1 << 5,
|
||||
CONTEXT_VALID_EAX = 1 << 3,
|
||||
CONTEXT_VALID_EBX = 1 << 4,
|
||||
CONTEXT_VALID_ECX = 1 << 5,
|
||||
CONTEXT_VALID_EDX = 1 << 6,
|
||||
CONTEXT_VALID_ESI = 1 << 7,
|
||||
CONTEXT_VALID_EDI = 1 << 8,
|
||||
CONTEXT_VALID_ALL = -1
|
||||
};
|
||||
|
||||
|
|
@ -77,7 +87,8 @@ struct StackFrameX86 : public StackFrame {
|
|||
: context(),
|
||||
context_validity(CONTEXT_VALID_NONE),
|
||||
trust(FRAME_TRUST_NONE),
|
||||
windows_frame_info(NULL) {}
|
||||
windows_frame_info(NULL),
|
||||
cfi_frame_info(NULL) {}
|
||||
~StackFrameX86();
|
||||
|
||||
// Register state. This is only fully valid for the topmost frame in a
|
||||
|
|
@ -95,10 +106,10 @@ struct StackFrameX86 : public StackFrame {
|
|||
// of this frame.
|
||||
FrameTrust trust;
|
||||
|
||||
// Any stack walking information we found describing
|
||||
// this.instruction. These may be NULL if we couldn't find the
|
||||
// appropriate information.
|
||||
// Any stack walking information we found describing this.instruction.
|
||||
// These may be NULL if there is no such information for that address.
|
||||
WindowsFrameInfo *windows_frame_info;
|
||||
CFIFrameInfo *cfi_frame_info;
|
||||
};
|
||||
|
||||
struct StackFramePPC : public StackFrame {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue