aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-12-13 22:10:23 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-12-13 22:10:23 +0000
commitef7262d4775bf6de750bc2a26dbf98368d7ec0c3 (patch)
treea85d6b8c2b66f2da9fdbef3fd0a936dd7f566ac4 /src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
parentReuse code and fix inconsistent array boundaries. (diff)
downloadbreakpad-ef7262d4775bf6de750bc2a26dbf98368d7ec0c3.tar.xz
allow passing info about known memory mappings to MinidumpWriter and ExceptionHandler
r=thestig at http://breakpad.appspot.com/242001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@741 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc')
-rw-r--r--src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
index 6b7ad5a2..27c2e994 100644
--- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -32,6 +32,7 @@
// id.
#include <pthread.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
@@ -58,7 +59,13 @@ void *thread_function(void *data) {
}
int main(int argc, char *argv[]) {
- int num_threads = atoi(argv[1]);
+ if (argc < 2) {
+ fprintf(stderr,
+ "usage: linux_dumper_unittest_helper <pipe fd> <# of threads\n");
+ return 1;
+ }
+ int pipefd = atoi(argv[1]);
+ int num_threads = atoi(argv[2]);
if (num_threads < 1) {
fprintf(stderr, "ERROR: number of threads is 0");
return 1;
@@ -70,6 +77,9 @@ int main(int argc, char *argv[]) {
for (int i = 1; i < num_threads; i++) {
pthread_create(&threads[i], &thread_attributes, &thread_function, NULL);
}
+ // Signal parent that this process has started all threads.
+ uint8_t byte = 1;
+ write(pipefd, &byte, sizeof(byte));
thread_function(NULL);
return 0;
}