This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/16779] New: "c &" in all-stop changes current thread
- From: "xdje42 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 30 Mar 2014 01:04:10 +0000
- Subject: [Bug gdb/16779] New: "c &" in all-stop changes current thread
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=16779
Bug ID: 16779
Summary: "c &" in all-stop changes current thread
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: xdje42 at gmail dot com
Created attachment 7505
--> https://sourceware.org/bugzilla/attachment.cgi?id=7505&action=edit
testcase
I noticed this while testing a patch to fix "interrupt".
If I do "c &" in all-stop mode, the current thread is changed.
Not sure this is a bug, per se (given that it's all-stop), but it is
unexpected.
(gdb) set target-async on
(gdb) b all_threads_running
Breakpoint 1 at 0x40079d: file forever-threads.c, line 36.
(gdb) r
Starting program: /home/dje/src/play/forever-threads.x64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
pid 13681 started
[New Thread 0x7ffff7fca700 (LWP 13685)]
thread tid 13685 started
[New Thread 0x7ffff7779700 (LWP 13686)]
thread tid 13686 started
[New Thread 0x7ffff6f28700 (LWP 13687)]
thread tid 13687 started
[New Thread 0x7ffff66d7700 (LWP 13688)]
thread tid 13688 started
Breakpoint 1, all_threads_running () at forever-threads.c:36
36 }
(gdb) i thr
Id Target Id Frame
5 Thread 0x7ffff66d7700 (LWP 13688) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
4 Thread 0x7ffff6f28700 (LWP 13687) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
3 Thread 0x7ffff7779700 (LWP 13686) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
2 Thread 0x7ffff7fca700 (LWP 13685) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
* 1 Thread 0x7ffff7fcc740 (LWP 13681) "forever-threads" all_threads_running
() at forever-threads.c:36
(gdb) thr 2
[Switching to thread 2 (Thread 0x7ffff7fca700 (LWP 13685))]
#0 0x000000362ccbd37d in nanosleep ()
at ../sysdeps/unix/syscall-template.S:81
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
(gdb) i thr
Id Target Id Frame
5 Thread 0x7ffff66d7700 (LWP 13688) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
4 Thread 0x7ffff6f28700 (LWP 13687) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
3 Thread 0x7ffff7779700 (LWP 13686) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
* 2 Thread 0x7ffff7fca700 (LWP 13685) "forever-threads" 0x000000362ccbd37d
in nanosleep () at ../sysdeps/unix/syscall-template.S:81
1 Thread 0x7ffff7fcc740 (LWP 13681) "forever-threads" all_threads_running
() at forever-threads.c:36
(gdb) c &
Continuing.
(gdb) i thr
Id Target Id Frame
5 Thread 0x7ffff66d7700 (LWP 13688) "forever-threads" (running)
4 Thread 0x7ffff6f28700 (LWP 13687) "forever-threads" (running)
3 Thread 0x7ffff7779700 (LWP 13686) "forever-threads" (running)
2 Thread 0x7ffff7fca700 (LWP 13685) "forever-threads" (running)
* 1 Thread 0x7ffff7fcc740 (LWP 13681) "forever-threads" (running)
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.