OLD | NEW |
1 // Copyright (c) 2014, Google Inc. | 1 // Copyright (c) 2014, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 ~MicrodumpWriter() { dumper_->ThreadsResume(); } | 80 ~MicrodumpWriter() { dumper_->ThreadsResume(); } |
81 | 81 |
82 bool Init() { | 82 bool Init() { |
83 // In the exceptional case where the system was out of memory and there | 83 // In the exceptional case where the system was out of memory and there |
84 // wasn't even room to allocate the line buffer, bail out. There is nothing | 84 // wasn't even room to allocate the line buffer, bail out. There is nothing |
85 // useful we can possibly achieve without the ability to Log. At least let's | 85 // useful we can possibly achieve without the ability to Log. At least let's |
86 // try to not crash. | 86 // try to not crash. |
87 if (!dumper_->Init() || !log_line_) | 87 if (!dumper_->Init() || !log_line_) |
88 return false; | 88 return false; |
89 return dumper_->ThreadsSuspend(); | 89 return dumper_->ThreadsSuspend() && dumper_->LateInit(); |
90 } | 90 } |
91 | 91 |
92 bool Dump() { | 92 bool Dump() { |
93 bool success; | 93 bool success; |
94 LogLine("-----BEGIN BREAKPAD MICRODUMP-----"); | 94 LogLine("-----BEGIN BREAKPAD MICRODUMP-----"); |
95 DumpProductInformation(); | 95 DumpProductInformation(); |
96 DumpOSInformation(); | 96 DumpOSInformation(); |
97 success = DumpCrashingThread(); | 97 success = DumpCrashingThread(); |
98 if (success) | 98 if (success) |
99 success = DumpMappings(); | 99 success = DumpMappings(); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 dumper.set_crash_thread(context->tid); | 414 dumper.set_crash_thread(context->tid); |
415 } | 415 } |
416 MicrodumpWriter writer(context, mappings, build_fingerprint, product_info, | 416 MicrodumpWriter writer(context, mappings, build_fingerprint, product_info, |
417 &dumper); | 417 &dumper); |
418 if (!writer.Init()) | 418 if (!writer.Init()) |
419 return false; | 419 return false; |
420 return writer.Dump(); | 420 return writer.Dump(); |
421 } | 421 } |
422 | 422 |
423 } // namespace google_breakpad | 423 } // namespace google_breakpad |
OLD | NEW |