diff options
author | Tobias Sargeant <tobiasjs@google.com> | 2017-08-18 17:29:38 +0100 |
---|---|---|
committer | Tobias Sargeant <tobiasjs@chromium.org> | 2017-08-21 10:19:07 +0000 |
commit | 2b3be5179e18975b4f12a9ecdf91ea08f3bb9f4b (patch) | |
tree | 84b95876299103166d899835410cfd3033b20ab7 /src/processor/microdump.cc | |
parent | Fix memory leak in ppc stackwalker (diff) | |
download | breakpad-2b3be5179e18975b4f12a9ecdf91ea08f3bb9f4b.tar.xz |
Add crash reason extraction to microdump processor
BUG=754715
Change-Id: I00fe62ed06dbbab4c8f6c416d56e2d444be11571
Reviewed-on: https://chromium-review.googlesource.com/621307
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Diffstat (limited to 'src/processor/microdump.cc')
-rw-r--r-- | src/processor/microdump.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc index 4af62f56..f8922228 100644 --- a/src/processor/microdump.cc +++ b/src/processor/microdump.cc @@ -54,6 +54,7 @@ static const char kMicrodumpBegin[] = "-----BEGIN BREAKPAD MICRODUMP-----"; static const char kMicrodumpEnd[] = "-----END BREAKPAD MICRODUMP-----"; static const char kOsKey[] = ": O "; static const char kCpuKey[] = ": C "; +static const char kCrashReasonKey[] = ": R "; static const char kGpuKey[] = ": G "; static const char kMmapKey[] = ": M "; static const char kStackKey[] = ": S "; @@ -212,7 +213,9 @@ Microdump::Microdump(const string& contents) : context_(new MicrodumpContext()), stack_region_(new MicrodumpMemoryRegion()), modules_(new MicrodumpModules()), - system_info_(new SystemInfo()) { + system_info_(new SystemInfo()), + crash_reason_(), + crash_address_(0u) { assert(!contents.empty()); bool in_microdump = false; @@ -350,6 +353,15 @@ Microdump::Microdump(const string& contents) } else { std::cerr << "Unsupported architecture: " << arch << std::endl; } + } else if ((pos = line.find(kCrashReasonKey)) != string::npos) { + string crash_reason_str(line, pos + strlen(kCrashReasonKey)); + std::istringstream crash_reason_tokens(crash_reason_str); + string signal; + string address; + crash_reason_tokens >> signal; + crash_reason_tokens >> crash_reason_; + crash_reason_tokens >> address; + crash_address_ = HexStrToL<uint64_t>(address); } else if ((pos = line.find(kGpuKey)) != string::npos) { string gpu_str(line, pos + strlen(kGpuKey)); if (strcmp(gpu_str.c_str(), kGpuUnknown) != 0) { |