diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-09-22 01:10:25 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-09-22 01:10:25 +0000 |
commit | 3402cae5e58f7503adc4d9de6d9ea69e725ddcb2 (patch) | |
tree | 8b35e29094057df5938145f622c017f09692c1cd /src/processor/minidump.h | |
parent | Handle frame pointer omission (#21), part 2: PostfixEvaluator. r=bryner. (diff) | |
download | breakpad-3402cae5e58f7503adc4d9de6d9ea69e725ddcb2.tar.xz |
Add ppc support to minidump reader (#27). r=bryner.
- Uses new MDRawContextPPC structure from #25.
- Interface change: (MinidumpContext).context() replaced with
GetContextCPU to determine CPU type and GetContextX86/GetContextPPC to
get CPU-specific context.
http://groups.google.com/group/airbag-dev/browse_thread/thread/f6c2e9cab2832b4c
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@33 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/minidump.h')
-rw-r--r-- | src/processor/minidump.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/processor/minidump.h b/src/processor/minidump.h index e02bbc29..1861213d 100644 --- a/src/processor/minidump.h +++ b/src/processor/minidump.h @@ -163,7 +163,19 @@ class MinidumpStream : public MinidumpObject { // user wants). class MinidumpContext : public MinidumpStream { public: - const MDRawContextX86* context() const { return valid_ ? &context_ : NULL; } + ~MinidumpContext(); + + // Returns an MD_CONTEXT_* value such as MD_CONTEXT_X86 or MD_CONTEXT_PPC + // identifying the CPU type that the context was collected from. The + // returned value will identify the CPU only, and will have any other + // MD_CONTEXT_* bits masked out. Returns 0 on failure. + u_int32_t GetContextCPU() const; + + // 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; // Print a human-readable representation of the object to stdout. void Print(); @@ -176,10 +188,22 @@ class MinidumpContext : public MinidumpStream { bool Read(u_int32_t expected_size); - // TODO(mmentovai): This is x86-only for now. When other CPUs are - // supported, this class can move to MinidumpContext_x86 and derive from - // a new abstract MinidumpContext. - MDRawContextX86 context_; + // Free the CPU-specific context structure. + void FreeContext(); + + // If the minidump contains a SYSTEM_INFO_STREAM, makes sure that the + // system info stream gives an appropriate CPU type matching the context + // CPU type in context_cpu_type. Returns false if the CPU type does not + // match. Returns true if the CPU type matches or if the minidump does + // not contain a system info stream. + bool CheckAgainstSystemInfo(u_int32_t context_cpu_type); + + // The CPU-specific context structure. + union { + MDRawContextBase* base; + MDRawContextX86* x86; + MDRawContextPPC* ppc; + } context_; }; |