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 breakpoints/13075] New: Hitting breakpoints in non-stop modedoesn't mention the thread that stopped


http://sourceware.org/bugzilla/show_bug.cgi?id=13075

             Bug #: 13075
           Summary: Hitting breakpoints in non-stop mode doesn't mention
                    the thread that stopped
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned@sourceware.org
        ReportedBy: pfee@talk21.com
    Classification: Unclassified


The GDB manual explains why the current thread isn't automatically switched to
the breaking thread:

"In non-stop mode, when a thread stops, gdb doesnât automatically make that
thread current, as it does in all-stop mode. This is because the thread stop
notifications are asynchronous with respect to gdbâs command interpreter, and
it would be confusing if gdb unexpectedly changed to a different thread just as
you entered a command to operate on the previously current thread."

It would be useful if the asynchronous notification included information about
which thread has stopped.

Currently the user can issue "info thread" and look for the thread that's
stopped.  However there may be multiple stopped threads and more than one might
already be stopped at the breakpoint already.

Current GDB output:
==================
(gdb) c -a &
Continuing.
(gdb)
Breakpoint 1, foo(bar=5) at foo.c:321
(gdb) info thr
  5 Thread 0x50feb90 (LWP 6155)  (running)
  4 Thread 0x2d43b90 (LWP 6156)  (running)
  3 Thread 0x2ab8b90 (LWP 6157)  foo(bar=5) at foo.c:321
  2 Thread 0x3347b90 (LWP 6158)  (running)
* 1 Thread 0x26d6b90 (LWP 6159)  (running)

Suggested GDB output:
=====================
(gdb) c -a &
Continuing.
(gdb)
Breakpoint 1, foo(bar=5) at foo.c:321, thread 3 (Thread 0x2ab8b90 (LWP 6157))
=====================

This additional thread information should only be shown in non-stop mode.  It
has little value in all-stop mode since that mode switches thread automatically
when breakpoints are hit.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]