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

Unified Diff: gdb/testsuite/gdb.threads/sigstep-threads.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 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.threads/siginfo-threads.exp ('k') | gdb/testsuite/gdb.threads/sigstep-threads.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.threads/sigstep-threads.c
diff --git a/gdb/testsuite/gdb.threads/fork-child-threads.c b/gdb/testsuite/gdb.threads/sigstep-threads.c
similarity index 60%
copy from gdb/testsuite/gdb.threads/fork-child-threads.c
copy to gdb/testsuite/gdb.threads/sigstep-threads.c
index bffe34e163dd3b03cee7313a494b93758d398ad4..ca77fe4602fee6a4a840991fe147d5a96a0c21fb 100644
--- a/gdb/testsuite/gdb.threads/fork-child-threads.c
+++ b/gdb/testsuite/gdb.threads/sigstep-threads.c
@@ -1,6 +1,6 @@
/* This testcase is part of GDB, the GNU debugger.
- Copyright 2008-2012 Free Software Foundation, Inc.
+ Copyright 2010-2012 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
@@ -17,34 +17,38 @@
#include <pthread.h>
#include <assert.h>
+#include <signal.h>
+
+#include <asm/unistd.h>
#include <unistd.h>
+#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, (tgid), (tid), (sig))
+#define gettid() syscall (__NR_gettid)
+
+static volatile int var;
+
+static void
+handler (int signo) /* step-0 */
+{ /* step-0 */
+ var++; /* step-1 */
+ tgkill (getpid (), gettid (), SIGUSR1); /* step-2 */
+}
static void *
start (void *arg)
{
+ tgkill (getpid (), gettid (), SIGUSR1);
assert (0);
- return arg;
+ return NULL;
}
-int main(void)
+int
+main (void)
{
pthread_t thread;
- int i;
-
- switch (fork ())
- {
- case -1:
- assert (0);
- default:
- break;
- case 0:
- i = pthread_create (&thread, NULL, start, NULL);
- assert (i == 0);
- i = pthread_join (thread, NULL);
- assert (i == 0);
-
- assert (0);
- }
+ signal (SIGUSR1, handler);
+
+ pthread_create (&thread, NULL, start, NULL);
+ start (NULL); /* main-start */
return 0;
}
« no previous file with comments | « gdb/testsuite/gdb.threads/siginfo-threads.exp ('k') | gdb/testsuite/gdb.threads/sigstep-threads.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698