Left: | ||
Right: |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 if (crash_handler_(&context, sizeof(context), callback_context_)) { | 408 if (crash_handler_(&context, sizeof(context), callback_context_)) { |
409 return true; | 409 return true; |
410 } | 410 } |
411 } | 411 } |
412 return GenerateDump(&context); | 412 return GenerateDump(&context); |
413 } | 413 } |
414 | 414 |
415 // This is a public interface to HandleSignal that allows the client to | 415 // This is a public interface to HandleSignal that allows the client to |
416 // generate a crash dump. This function may run in a compromised context. | 416 // generate a crash dump. This function may run in a compromised context. |
417 bool ExceptionHandler::SimulateSignalDelivery(int sig) { | 417 bool ExceptionHandler::SimulateSignalDelivery(int sig) { |
418 siginfo_t siginfo; | 418 siginfo_t siginfo = {}; |
419 my_memset(&siginfo, 0, sizeof(siginfo_t)); | 419 siginfo.si_code = SI_USER; |
Mark Mentovai
2013/01/14 17:33:22
Comment-worthy.
glider1
2013/01/14 18:02:11
Done.
| |
420 siginfo.si_pid = getpid(); | |
420 struct ucontext context; | 421 struct ucontext context; |
421 getcontext(&context); | 422 getcontext(&context); |
422 return HandleSignal(sig, &siginfo, &context); | 423 return HandleSignal(sig, &siginfo, &context); |
423 } | 424 } |
424 | 425 |
425 // This function may run in a compromised context: see the top of the file. | 426 // This function may run in a compromised context: see the top of the file. |
426 bool ExceptionHandler::GenerateDump(CrashContext *context) { | 427 bool ExceptionHandler::GenerateDump(CrashContext *context) { |
427 if (IsOutOfProcess()) | 428 if (IsOutOfProcess()) |
428 return crash_generation_client_->RequestDump(context, sizeof(*context)); | 429 return crash_generation_client_->RequestDump(context, sizeof(*context)); |
429 | 430 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
644 descriptor.UpdatePath(); | 645 descriptor.UpdatePath(); |
645 if (!google_breakpad::WriteMinidump(descriptor.path(), | 646 if (!google_breakpad::WriteMinidump(descriptor.path(), |
646 child, | 647 child, |
647 child_blamed_thread)) | 648 child_blamed_thread)) |
648 return false; | 649 return false; |
649 | 650 |
650 return callback ? callback(descriptor, callback_context, true) : true; | 651 return callback ? callback(descriptor, callback_context, true) : true; |
651 } | 652 } |
652 | 653 |
653 } // namespace google_breakpad | 654 } // namespace google_breakpad |
OLD | NEW |