OLD | NEW |
1 // Copyright (c) 2010, Google Inc. | 1 // Copyright (c) 2010, 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 bool Init() { | 148 bool Init() { |
149 if (!dumper_->Init()) | 149 if (!dumper_->Init()) |
150 return false; | 150 return false; |
151 | 151 |
152 if (fd_ != -1) | 152 if (fd_ != -1) |
153 minidump_writer_.SetFile(fd_); | 153 minidump_writer_.SetFile(fd_); |
154 else if (!minidump_writer_.Open(path_)) | 154 else if (!minidump_writer_.Open(path_)) |
155 return false; | 155 return false; |
156 | 156 |
157 return dumper_->ThreadsSuspend(); | 157 return dumper_->ThreadsSuspend() && dumper_->LateInit(); |
158 } | 158 } |
159 | 159 |
160 ~MinidumpWriter() { | 160 ~MinidumpWriter() { |
161 // Don't close the file descriptor when it's been provided explicitly. | 161 // Don't close the file descriptor when it's been provided explicitly. |
162 // Callers might still need to use it. | 162 // Callers might still need to use it. |
163 if (fd_ == -1) | 163 if (fd_ == -1) |
164 minidump_writer_.Close(); | 164 minidump_writer_.Close(); |
165 dumper_->ThreadsResume(); | 165 dumper_->ThreadsResume(); |
166 } | 166 } |
167 | 167 |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 const MappingList& mappings, | 1364 const MappingList& mappings, |
1365 const AppMemoryList& appmem, | 1365 const AppMemoryList& appmem, |
1366 LinuxDumper* dumper) { | 1366 LinuxDumper* dumper) { |
1367 MinidumpWriter writer(filename, -1, NULL, mappings, appmem, dumper); | 1367 MinidumpWriter writer(filename, -1, NULL, mappings, appmem, dumper); |
1368 if (!writer.Init()) | 1368 if (!writer.Init()) |
1369 return false; | 1369 return false; |
1370 return writer.Dump(); | 1370 return writer.Dump(); |
1371 } | 1371 } |
1372 | 1372 |
1373 } // namespace google_breakpad | 1373 } // namespace google_breakpad |
OLD | NEW |