diff options
author | Pedro Alves <palves@redhat.com> | 2009-05-28 17:19:58 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2009-05-28 17:19:58 +0000 |
commit | b3444185bd700fa4e5cea80a10298cf8d16bcbce (patch) | |
tree | 1330f456627b45848d64ce310201f76b3b4c7628 /gdb/testsuite/gdb.threads/thread-execl.c | |
parent | 8f5008704e9f9e282da288b71fefb96e889ea961 (diff) | |
download | gdb-b3444185bd700fa4e5cea80a10298cf8d16bcbce.zip gdb-b3444185bd700fa4e5cea80a10298cf8d16bcbce.tar.gz gdb-b3444185bd700fa4e5cea80a10298cf8d16bcbce.tar.bz2 |
gdb/
2009-05-28 Pedro Alves <pedro@codesourcery.com>
* infrun.c (handle_inferior_event): When thread hoping, switch
inferior_ptid to the event thread before removing breakpoints from
the target. If not stopping, also try to revert back to a thread
that was doing a "next". Check if that thread still exists before
resuming.
(currently_stepping_thread): Delete and merge with ...
(currently_stepping): ... this.
(currently_stepping_callback): Rename to ...
(currently_stepping_or_nexting_callback): ... this, and also
return true if the thread was stepping over a call (has a
step-resume breakpoint).
gdb/testsuite/
2009-05-28 Pedro Alves <pedro@codesourcery.com>
* gdb.threads/threxit-hop-specific.c: New.
* gdb.threads/threxit-hop-specific.exp: New.
* gdb.threads/thread-execl.c: New.
* gdb.threads/thread-execl.exp: New.
Diffstat (limited to 'gdb/testsuite/gdb.threads/thread-execl.c')
-rw-r--r-- | gdb/testsuite/gdb.threads/thread-execl.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.threads/thread-execl.c b/gdb/testsuite/gdb.threads/thread-execl.c new file mode 100644 index 0000000..ec23535 --- /dev/null +++ b/gdb/testsuite/gdb.threads/thread-execl.c @@ -0,0 +1,48 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2009 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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> +#include <unistd.h> +#include <stdlib.h> + +static const char *image; + +void * +thread_execler (void *arg) +{ + /* Exec ourselves again. */ + if (execl (image, image, NULL) == -1) + { + perror ("execl"); + abort (); + } + + return NULL; +} + +int +main (int argc, char **argv) +{ + pthread_t thread; + + image = argv[0]; + + pthread_create (&thread, NULL, thread_execler, NULL); + pthread_join (thread, NULL); + + return 0; +} |