OLD | NEW |
1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "processor/logging.h" | 44 #include "processor/logging.h" |
45 #include "processor/stackwalker_x86.h" | 45 #include "processor/stackwalker_x86.h" |
46 #include "processor/symbolic_constants_win.h" | 46 #include "processor/symbolic_constants_win.h" |
47 | 47 |
48 namespace google_breakpad { | 48 namespace google_breakpad { |
49 | 49 |
50 MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier, | 50 MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier, |
51 SourceLineResolverInterface *resolver) | 51 SourceLineResolverInterface *resolver) |
52 : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)), | 52 : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)), |
53 own_frame_symbolizer_(true), | 53 own_frame_symbolizer_(true), |
54 enable_exploitability_(false) { | 54 enable_exploitability_(false), |
| 55 enable_objdump_(false) { |
55 } | 56 } |
56 | 57 |
57 MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier, | 58 MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier, |
58 SourceLineResolverInterface *resolver, | 59 SourceLineResolverInterface *resolver, |
59 bool enable_exploitability) | 60 bool enable_exploitability) |
60 : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)), | 61 : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)), |
61 own_frame_symbolizer_(true), | 62 own_frame_symbolizer_(true), |
62 enable_exploitability_(enable_exploitability) { | 63 enable_exploitability_(enable_exploitability), |
| 64 enable_objdump_(false) { |
63 } | 65 } |
64 | 66 |
65 MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer *frame_symbolizer, | 67 MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer *frame_symbolizer, |
66 bool enable_exploitability) | 68 bool enable_exploitability) |
67 : frame_symbolizer_(frame_symbolizer), | 69 : frame_symbolizer_(frame_symbolizer), |
68 own_frame_symbolizer_(false), | 70 own_frame_symbolizer_(false), |
69 enable_exploitability_(enable_exploitability) { | 71 enable_exploitability_(enable_exploitability), |
| 72 enable_objdump_(false) { |
70 assert(frame_symbolizer_); | 73 assert(frame_symbolizer_); |
71 } | 74 } |
72 | 75 |
73 MinidumpProcessor::~MinidumpProcessor() { | 76 MinidumpProcessor::~MinidumpProcessor() { |
74 if (own_frame_symbolizer_) delete frame_symbolizer_; | 77 if (own_frame_symbolizer_) delete frame_symbolizer_; |
75 } | 78 } |
76 | 79 |
77 ProcessResult MinidumpProcessor::Process( | 80 ProcessResult MinidumpProcessor::Process( |
78 Minidump *dump, ProcessState *process_state) { | 81 Minidump *dump, ProcessState *process_state) { |
79 assert(dump); | 82 assert(dump); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 process_state->requesting_thread_ = -1; | 285 process_state->requesting_thread_ = -1; |
283 } | 286 } |
284 | 287 |
285 // Exploitability defaults to EXPLOITABILITY_NOT_ANALYZED | 288 // Exploitability defaults to EXPLOITABILITY_NOT_ANALYZED |
286 process_state->exploitability_ = EXPLOITABILITY_NOT_ANALYZED; | 289 process_state->exploitability_ = EXPLOITABILITY_NOT_ANALYZED; |
287 | 290 |
288 // If an exploitability run was requested we perform the platform specific | 291 // If an exploitability run was requested we perform the platform specific |
289 // rating. | 292 // rating. |
290 if (enable_exploitability_) { | 293 if (enable_exploitability_) { |
291 scoped_ptr<Exploitability> exploitability( | 294 scoped_ptr<Exploitability> exploitability( |
292 Exploitability::ExploitabilityForPlatform(dump, process_state)); | 295 Exploitability::ExploitabilityForPlatform(dump, |
| 296 process_state, |
| 297 enable_objdump_)); |
293 // The engine will be null if the platform is not supported | 298 // The engine will be null if the platform is not supported |
294 if (exploitability != NULL) { | 299 if (exploitability != NULL) { |
295 process_state->exploitability_ = exploitability->CheckExploitability(); | 300 process_state->exploitability_ = exploitability->CheckExploitability(); |
296 } else { | 301 } else { |
297 process_state->exploitability_ = EXPLOITABILITY_ERR_NOENGINE; | 302 process_state->exploitability_ = EXPLOITABILITY_ERR_NOENGINE; |
298 } | 303 } |
299 } | 304 } |
300 | 305 |
301 BPLOG(INFO) << "Processed " << dump->path(); | 306 BPLOG(INFO) << "Processed " << dump->path(); |
302 return PROCESS_OK; | 307 return PROCESS_OK; |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 char assertion_line[32]; | 1532 char assertion_line[32]; |
1528 snprintf(assertion_line, sizeof(assertion_line), "%u", raw_assertion->line); | 1533 snprintf(assertion_line, sizeof(assertion_line), "%u", raw_assertion->line); |
1529 assertion_string.append(" at line "); | 1534 assertion_string.append(" at line "); |
1530 assertion_string.append(assertion_line); | 1535 assertion_string.append(assertion_line); |
1531 } | 1536 } |
1532 | 1537 |
1533 return assertion_string; | 1538 return assertion_string; |
1534 } | 1539 } |
1535 | 1540 |
1536 } // namespace google_breakpad | 1541 } // namespace google_breakpad |
OLD | NEW |