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

Unified Diff: gdb/testsuite/gdb.base/siginfo-thread.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 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 | « gdb/testsuite/gdb.base/siginfo-obj.exp ('k') | gdb/testsuite/gdb.base/siginfo-thread.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.base/siginfo-thread.c
diff --git a/gdb/testsuite/gdb.base/siginfo-obj.c b/gdb/testsuite/gdb.base/siginfo-thread.c
similarity index 85%
copy from gdb/testsuite/gdb.base/siginfo-obj.c
copy to gdb/testsuite/gdb.base/siginfo-thread.c
index cb50126f727a7f91076f3cd3f067c0f7f5acd734..01f738165ab946eb043f261e078ec51c7636258d 100644
--- a/gdb/testsuite/gdb.base/siginfo-obj.c
+++ b/gdb/testsuite/gdb.base/siginfo-thread.c
@@ -1,6 +1,6 @@
/* This testcase is part of GDB, the GNU debugger.
- Copyright 2004, 2007-2008, 2010-2012 Free Software Foundation, Inc.
+ Copyright 2004-2013 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
+#include <pthread.h>
static void *p;
@@ -38,9 +39,17 @@ handler (int sig, siginfo_t *info, void *context)
_exit (0); /* set breakpoint here */
}
+static void *
+segv_thread (void *ptr)
+{
+ *(int *)ptr = 0;
+}
+
int
main (void)
{
+ pthread_t thr;
+
/* Set up unwritable memory. */
{
size_t len;
@@ -64,7 +73,11 @@ main (void)
return 1;
}
}
- /* Trigger SIGSEGV. */
- *(int *)p = 0;
+
+ /* Create a thread that will trigger SIGSEGV. */
+ pthread_create (&thr, NULL, segv_thread, p);
+
+ pthread_join (thr, NULL);
+
return 0;
}
« no previous file with comments | « gdb/testsuite/gdb.base/siginfo-obj.exp ('k') | gdb/testsuite/gdb.base/siginfo-thread.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698