diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-05-29 00:53:02 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-05-29 00:53:02 +0000 |
commit | b56cfa067add059d0894433393e798fe0604970e (patch) | |
tree | d64deaf11ab7d098edd90f020d6ea1e889d53bdc /src/google_breakpad/processor/minidump_processor.h | |
parent | Fix minidump_stackwalk compilation on gcc 4.3. Patch by Jim Blandy (diff) | |
download | breakpad-b56cfa067add059d0894433393e798fe0604970e.tar.xz |
Add more error information to minidump processing return code. Also added dependency on google test, and modified minidump processing unit tests to use google test
R=brdevmn
A=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@343 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor/minidump_processor.h')
-rw-r--r-- | src/google_breakpad/processor/minidump_processor.h | 71 |
1 files changed, 64 insertions, 7 deletions
diff --git a/src/google_breakpad/processor/minidump_processor.h b/src/google_breakpad/processor/minidump_processor.h index 73447f97..f313bf71 100644 --- a/src/google_breakpad/processor/minidump_processor.h +++ b/src/google_breakpad/processor/minidump_processor.h @@ -30,6 +30,7 @@ #ifndef GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_PROCESSOR_H__ #define GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_PROCESSOR_H__ +#include <cassert> #include <string> #include "google_breakpad/common/breakpad_types.h" @@ -42,16 +43,53 @@ class ProcessState; class SourceLineResolverInterface; class SymbolSupplier; class SystemInfo; +// Return type for Process() +enum ProcessResult { + PROCESS_OK, // The minidump was + // processed + // successfully. + + PROCESS_ERROR_MINIDUMP_NOT_FOUND, // The minidump file + // was not found. + + PROCESS_ERROR_NO_MINIDUMP_HEADER, // The minidump file + // had no header + + PROCESS_ERROR_NO_THREAD_LIST, // The minidump file + // had no thread list. + + PROCESS_ERROR_GETTING_THREAD, // There was an error + // getting one + // thread's data from + // the minidump. + + PROCESS_ERROR_GETTING_THREAD_ID, // There was an error + // getting a thread id + // from the thread's + // data. + + PROCESS_ERROR_DUPLICATE_REQUESTING_THREADS, // There was more than + // one requesting + // thread. + + PROCESS_ERROR_NO_MEMORY_FOR_THREAD, // A thread had no + // memory region. + + PROCESS_ERROR_NO_STACKWALKER_FOR_THREAD, // We couldn't + // determine the + // StackWalker to walk + // the minidump's + // threads. + + PROCESS_SYMBOL_SUPPLIER_INTERRUPTED // The minidump + // processing was + // interrupted by the + // SymbolSupplier(not + // fatal) +}; class MinidumpProcessor { public: - // Return type for Process() - enum ProcessResult { - PROCESS_OK, // the minidump was processed successfully - PROCESS_ERROR, // there was an error processing the minidump - PROCESS_INTERRUPTED // processing was interrupted by the SymbolSupplier - }; - // Initializes this MinidumpProcessor. supplier should be an // implementation of the SymbolSupplier abstract base class. MinidumpProcessor(SymbolSupplier *supplier, @@ -62,6 +100,10 @@ class MinidumpProcessor { ProcessResult Process(const string &minidump_file, ProcessState *process_state); + // Processes the minidump structure and fills process_state with the + // result. + ProcessResult Process(Minidump *minidump, + ProcessState *process_state); // Populates the cpu_* fields of the |info| parameter with textual // representations of the CPU type that the minidump in |dump| was // produced on. Returns false if this information is not available in @@ -84,6 +126,21 @@ class MinidumpProcessor { // was caused by a memory access violation. static string GetCrashReason(Minidump *dump, u_int64_t *address); + // This function returns true if the passed-in error code is + // something unrecoverable(i.e. retry should not happen). For + // instance, if the minidump is corrupt, then it makes no sense to + // retry as we won't be able to glean additional information. + // However, as an example of the other case, the symbol supplier can + // return an error code indicating it was 'interrupted', which can + // happen of the symbols are fetched from a remote store, and a + // retry might be successful later on. + // You should not call this method with PROCESS_OK! Test for + // that separately before calling this. + static bool IsErrorUnrecoverable(ProcessResult p) { + assert(p != PROCESS_OK); + return (p != PROCESS_SYMBOL_SUPPLIER_INTERRUPTED); + } + private: SymbolSupplier *supplier_; SourceLineResolverInterface *resolver_; |