Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Unified Diff: src/untrusted/minidump_generator/minidump_generator.cc

Issue 14876015: Add wrapper library for the nacl_irt_exception_handling IRT interface (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Cleanup + remove minidump_generator.gyp for now because of pthread.h problem in Gyp build Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/untrusted/crash_dump/untrusted_crash_dump.c ('k') | src/untrusted/nacl/nacl.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/minidump_generator/minidump_generator.cc
diff --git a/src/untrusted/minidump_generator/minidump_generator.cc b/src/untrusted/minidump_generator/minidump_generator.cc
index b0bee824641e18f0fa30b37a5ed3e6ede0e0d368..0f32c5d5f87eecff4d5729f572329cfd45ac6da8 100644
--- a/src/untrusted/minidump_generator/minidump_generator.cc
+++ b/src/untrusted/minidump_generator/minidump_generator.cc
@@ -5,12 +5,14 @@
*/
#include <assert.h>
+#include <errno.h>
#include <pthread.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
+#include <time.h>
#include <unistd.h>
#include <algorithm>
@@ -19,7 +21,6 @@
#include "native_client/src/include/elf_constants.h"
#include "native_client/src/include/nacl/nacl_exception.h"
#include "native_client/src/include/nacl/nacl_minidump.h"
-#include "native_client/src/untrusted/irt/irt.h"
#include "native_client/src/untrusted/minidump_generator/build_id.c"
@@ -65,7 +66,7 @@ class MinidumpFileWriter {
void *mapping = mmap(NULL, kMinidumpBufferSize, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (mapping == MAP_FAILED) {
- fprintf(stderr, "minidump: Failed to preallocate memory\n");
+ perror("minidump: Failed to preallocate memory");
return;
}
buf_ = (char *) mapping;
@@ -418,16 +419,9 @@ static void CrashHandler(struct NaClExceptionContext *context) {
}
void nacl_minidump_register_crash_handler(void) {
- struct nacl_irt_exception_handling irt_exception_handling;
- if (nacl_interface_query(NACL_IRT_EXCEPTION_HANDLING_v0_1,
- &irt_exception_handling,
- sizeof(irt_exception_handling))
- != sizeof(irt_exception_handling)) {
- fprintf(stderr, "minidump: Exception handling IRT interface not present\n");
- return;
- }
- if (irt_exception_handling.exception_handler(CrashHandler, NULL) != 0) {
- fprintf(stderr, "minidump: Failed to register an exception handler\n");
+ errno = nacl_exception_set_handler(CrashHandler);
+ if (errno != 0) {
+ perror("minidump: Failed to register an exception handler");
return;
}
« no previous file with comments | « src/untrusted/crash_dump/untrusted_crash_dump.c ('k') | src/untrusted/nacl/nacl.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698