aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-10-31 19:20:31 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-10-31 19:20:31 +0000
commit8eb7111814953cb64ec0569b91ea99804b2d5b85 (patch)
treece847bcddb073b3c4ce9d1fbb2a3f4456d62b27d /src/google_breakpad/processor
parentFix warning regarding initialization order compared to definition order (diff)
downloadbreakpad-8eb7111814953cb64ec0569b91ea99804b2d5b85.tar.xz
Issue 196 - Breakpad processor support for x86-64. r=mento
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@227 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r--src/google_breakpad/processor/minidump.h15
-rw-r--r--src/google_breakpad/processor/stack_frame_cpu.h26
2 files changed, 36 insertions, 5 deletions
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h
index 474382b9..4e900fb1 100644
--- a/src/google_breakpad/processor/minidump.h
+++ b/src/google_breakpad/processor/minidump.h
@@ -175,8 +175,9 @@ class MinidumpContext : public MinidumpStream {
// Returns raw CPU-specific context data for the named CPU type. If the
// context data does not match the CPU type or does not exist, returns
// NULL.
- const MDRawContextX86* GetContextX86() const;
- const MDRawContextPPC* GetContextPPC() const;
+ const MDRawContextX86* GetContextX86() const;
+ const MDRawContextPPC* GetContextPPC() const;
+ const MDRawContextAMD64* GetContextAMD64() const;
const MDRawContextSPARC* GetContextSPARC() const;
// Print a human-readable representation of the object to stdout.
@@ -200,11 +201,15 @@ class MinidumpContext : public MinidumpStream {
// not contain a system info stream.
bool CheckAgainstSystemInfo(u_int32_t context_cpu_type);
+ // Store this separately because of the weirdo AMD64 context
+ u_int32_t context_flags_;
+
// The CPU-specific context structure.
union {
- MDRawContextBase* base;
- MDRawContextX86* x86;
- MDRawContextPPC* ppc;
+ MDRawContextBase* base;
+ MDRawContextX86* x86;
+ MDRawContextPPC* ppc;
+ MDRawContextAMD64* amd64;
// on Solaris SPARC, sparc is defined as a numeric constant,
// so variables can NOT be named as sparc
MDRawContextSPARC* ctx_sparc;
diff --git a/src/google_breakpad/processor/stack_frame_cpu.h b/src/google_breakpad/processor/stack_frame_cpu.h
index 567c1b7e..a8840278 100644
--- a/src/google_breakpad/processor/stack_frame_cpu.h
+++ b/src/google_breakpad/processor/stack_frame_cpu.h
@@ -98,6 +98,32 @@ struct StackFramePPC : public StackFrame {
int context_validity;
};
+struct StackFrameAMD64 : public StackFrame {
+ // ContextValidity has one entry for each relevant hardware pointer register
+ // (%rip and %rsp) and one entry for each nonvolatile (callee-save) register.
+ //FIXME: validate this list
+ enum ContextValidity {
+ CONTEXT_VALID_NONE = 0,
+ CONTEXT_VALID_RIP = 1 << 0,
+ CONTEXT_VALID_RSP = 1 << 1,
+ CONTEXT_VALID_RBP = 1 << 2,
+ CONTEXT_VALID_ALL = -1
+ };
+
+ StackFrameAMD64() : context(), context_validity(CONTEXT_VALID_NONE) {}
+
+ // Register state. This is only fully valid for the topmost frame in a
+ // stack. In other frames, the values of nonvolatile registers may be
+ // present, given sufficient debugging information. Refer to
+ // context_validity.
+ MDRawContextAMD64 context;
+
+ // context_validity is actually ContextValidity, but int is used because
+ // the OR operator doesn't work well with enumerated types. This indicates
+ // which fields in context are valid.
+ int context_validity;
+};
+
struct StackFrameSPARC : public StackFrame {
// to be confirmed
enum ContextValidity {