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

Unified Diff: gdb/testsuite/gdb.trace/trace-mt.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.trace/trace-break.exp ('k') | gdb/testsuite/gdb.trace/trace-mt.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.trace/trace-mt.c
diff --git a/gdb/testsuite/gdb.trace/ftrace.c b/gdb/testsuite/gdb.trace/trace-mt.c
similarity index 63%
copy from gdb/testsuite/gdb.trace/ftrace.c
copy to gdb/testsuite/gdb.trace/trace-mt.c
index bab992d06a89500d9dbde4123d19394b975e9fa6..90a5b54c77b1040d644b25beb419f9eb8bcc53ec 100644
--- a/gdb/testsuite/gdb.trace/ftrace.c
+++ b/gdb/testsuite/gdb.trace/trace-mt.c
@@ -1,6 +1,6 @@
/* This testcase is part of GDB, the GNU debugger.
- Copyright 2011-2012 Free Software Foundation, Inc.
+ Copyright 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
@@ -15,46 +15,30 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#ifdef SYMBOL_PREFIX
#define SYMBOL(str) SYMBOL_PREFIX #str
#else
#define SYMBOL(str) #str
#endif
-
-int globvar;
-
-static void
-begin (void)
-{}
-
/* Called from asm. */
static void __attribute__((used))
func (void)
{}
-static void
-marker (int anarg)
+static void *
+thread_function(void *arg)
{
- /* `set_point' is the label at which to set a fast tracepoint. The
+ /* `set_point1' is the label at which to set a fast tracepoint. The
insn at the label must be large enough to fit a fast tracepoint
jump. */
- asm (" .global " SYMBOL(set_point) "\n"
- SYMBOL(set_point) ":\n"
+ asm (" .global " SYMBOL(set_point1) "\n"
+ SYMBOL(set_point1) ":\n"
#if (defined __x86_64__ || defined __i386__)
" call " SYMBOL(func) "\n"
#endif
);
-
- ++anarg;
-
- /* Set up a known 4-byte instruction so we can try to set a shorter
- fast tracepoint at it. */
- asm (" .global " SYMBOL(four_byter) "\n"
- SYMBOL(four_byter) ":\n"
-#if (defined __i386__)
- " cmpl $0x1,0x8(%ebp) \n"
-#endif
- );
}
static void
@@ -62,15 +46,18 @@ end (void)
{}
int
-main ()
+main (int argc, char *argv[], char *envp[])
{
- begin ();
+ pthread_t threads[2];
+ int i;
+
+ for (i = 0; i < 2; i++)
+ pthread_create (&threads[i], NULL, thread_function, NULL);
- for (globvar = 1; globvar < 11; ++globvar)
- {
- marker (globvar * 100);
- }
+ for (i = 0; i < 2; i++)
+ pthread_join (threads[i], NULL);
end ();
+
return 0;
}
« no previous file with comments | « gdb/testsuite/gdb.trace/trace-break.exp ('k') | gdb/testsuite/gdb.trace/trace-mt.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698