This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug threads/19650] New: In all-stop async, "-exec-interrupt --thread <id>" always generates a *stopped event about thread 1


https://sourceware.org/bugzilla/show_bug.cgi?id=19650

            Bug ID: 19650
           Summary: In all-stop async, "-exec-interrupt --thread <id>"
                    always generates a *stopped event about thread 1
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: threads
          Assignee: unassigned at sourceware dot org
          Reporter: marc.khouzam at ericsson dot com
                CC: marc.dumais at ericsson dot com, simon.marchi at ericsson dot com
  Target Milestone: ---

1- Run a multi-threaded program in all-stop async.  

2- With multiple threads running, send the -exec-interrupt command with a
specific thread id (not 1), such as -exec-interrupt --thread 3.

=> The resulting *stopped event will specify "thread-id="1"" 

With Eclipse, this will eventually be a limitation because users that press
interrupt when thread 3 is selected, would like to keep thread 3 selected after
the interruption.  If GDB always specifies thread 1 as the cause for the stop,
Eclipse will always select thread 1.

Below is a session showing the situation with the last line being the *stopped
event showing thread="1"



> ./gdb/gdb -i mi ~/runtime-TestDSF/Producer/Debug/Producer
[...]
~"GNU gdb (GDB) 7.11.50.20160217-git\n"
[...]
~"Reading symbols from
/home/lmckhou/runtime-TestDSF/Producer/Debug/Producer..."
~"done.\n"
(gdb) set mi-async on
&"set mi-async on\n"
=cmd-param-changed,param="mi-async",value="on"
^done
(gdb) start
&"start\n"
[...]
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x0000000000401062",func="main",args=[],file="../src/Producer.cpp",fullname="/home/lmckhou/runtime-TestDSF/Producer/src/Producer.cpp",line="157"},thread-id="1",stopped-threads="all",core="0"
=breakpoint-deleted,id="1"
-exec-continue
^running
*running,thread-id="all"
(gdb) 
=thread-created,id="2",group-id="i1"
~"[New Thread 0x7ffff6f6e700 (LWP 1808)]\n"
*running,thread-id="2"
=thread-created,id="3",group-id="i1"
~"[New Thread 0x7ffff676d700 (LWP 1809)]\n"
*running,thread-id="3"
=thread-created,id="4",group-id="i1"
~"[New Thread 0x7ffff5f6c700 (LWP 1810)]\n"
*running,thread-id="4"
=thread-created,id="5",group-id="i1"
~"[New Thread 0x7ffff576b700 (LWP 1811)]\n"
*running,thread-id="5"
(gdb) i thread
&"i thread\n"
~"  Id   Target Id         Frame \n"
~"* 1    Thread 0x7ffff7fd9740 (LWP 1780) \"Main\" (running)\n"
~"  2    Thread 0x7ffff6f6e700 (LWP 1808) \"Sending\" (running)\n"
~"  3    Thread 0x7ffff676d700 (LWP 1809) \"The receiver\" (running)\n"
~"  4    Thread 0x7ffff5f6c700 (LWP 1810) \"I am the worker\" (running)\n"
~"  5    Thread 0x7ffff576b700 (LWP 1811) \"Producer thread\" (running)\n"
^done
~"[Thread 0x7ffff5f6c700 (LWP 1810) exited]\n"
=thread-exited,id="4",group-id="i1"
(gdb) -exec-interrupt --thread 3
^done
(gdb) 
~"\nThread "
~"1 \"Main\" received signal SIGINT, Interrupt.\n"
~"0x00007ffff7bc6148 in pthread_join () from
/lib/x86_64-linux-gnu/libpthread.so.0\n"
*stopped,reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt",frame={addr="0x00007ffff7bc6148",func="pthread_join",args=[],from="/lib/x86_64-linux-gnu/libpthread.so.0"},thread-id="1",stopped-threads="all",core="2"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]