This is the mail archive of the gdb-patches@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]

[PATCH 0/4] remote thread listing: get rid of unnecessary "thread alive?" traffic


When GDB wants to sync the thread list with the target's (e.g., due to
"info threads"), it ends up sending a bunch of T (thread alive?)
packets before fetching the current remote thread list:

 Sending packet: $Tp2141.2150#82...Packet received: OK
 Sending packet: $Tp2141.214f#b7...Packet received: OK
 Sending packet: $Tp2141.2141#82...Packet received: OK
 Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p2141.2141" core="2"/>\n<thread id="p2141.214f" core="1"/>\n<thread id="p2141.2150" core="2"/>\n</threads>\n

That's wasteful, given that we can tell whether a thread is gone from
the fact that it won't appear in the list returned by
qXfer:threads:read (or qfThreadInfo/qsThreadInfo, or qL).

This series eliminates those unnecessary queries.

IOW, after this series, the above becomes simply:

 Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p2141.2141" core="2"/>\n<thread id="p2141.214f" core="1"/>\n<thread id="p2141.2150" core="2"/>\n</threads>\n

Pedro Alves (4):
  Merge remote thread listing methods
  Push pruning old threads down to the target
  remote: get rid of all the T packets when synching the thread list
  DEC threads: Simplify updating the thread list

 gdb/ada-tasks.c        |   4 +-
 gdb/bsd-uthread.c      |   6 +-
 gdb/corelow.c          |   2 +-
 gdb/dec-thread.c       |  80 ++++--------
 gdb/gdbthread.h        |  12 ++
 gdb/linux-thread-db.c  |   6 +-
 gdb/nto-procfs.c       |  10 +-
 gdb/obsd-nat.c         |   6 +-
 gdb/procfs.c           |  10 +-
 gdb/ravenscar-thread.c |  10 +-
 gdb/record-btrace.c    |  10 +-
 gdb/remote.c           | 339 +++++++++++++++++++++++++++++--------------------
 gdb/sol-thread.c       |  21 +--
 gdb/target-delegates.c |  22 ++--
 gdb/target.c           |   4 +-
 gdb/target.h           |   6 +-
 gdb/thread.c           |   8 +-
 17 files changed, 301 insertions(+), 255 deletions(-)

-- 
1.9.3


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