Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/6] PR 17539 - inferiors/threads etc. print in reverse order
Date: Thu, 22 Oct 2015 10:56:00 -0000	[thread overview]
Message-ID: <1445507944-9197-1-git-send-email-palves@redhat.com> (raw)

PR 17539 points out that "info inferiors" lists inferiors in
decreasing order.  I audited the "info" sub commands, and GDB is
inconsistent on this issue in several places.  Some commands list in
ascending order, while others in descending order.

For example, ascending order:

  (gdb) info breakpoints
  Num     Type           Disp Enb Address            What
  1       breakpoint     keep y   0x00000000004008ad in main at foo.c:81
  2       breakpoint     keep y   0x00000000004008ad in main at foo.c:81
  3       breakpoint     keep y   0x00000000004008ad in main at foo.c:81
  4       breakpoint     keep y   0x00000000004008ad in main at foo.c:81
  (gdb)

  (gdb) info skip
  Num     Type           Enb What
  1       function       y   main
  2       function       y   main
  3       function       y   main
  (gdb)

  (gdb) info bookmarks
     1       0x4008ad    '0'
     2       0x4008ad    '0'
     3       0x4008ad    '0'
     4       0x4008ad    '0'
  (gdb)

  (gdb) info tasks
    ID       TID P-ID Pri State                 Name
     1   8088000   0   15 Child Activation Wait main_task
     2   80a4000   1   15 Accept Statement      b
     3   809a800   1   15 Child Activation Wait a
  *  4   80ae800   3   15 Runnable              c
  (gdb)

Descending:

  (gdb) info display
  Auto-display expressions now in effect:
  Num Enb Expression
  4:   y  1
  3:   y  1
  2:   y  1
  1:   y  1
  (gdb)

  (gdb) info threads
    Id   Target Id         Frame
    3    Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30
    2    Thread 0x7ffff7fc4700 (LWP 29034) function (arg=0x0) at foo.c:60
  * 1    Thread 0x7ffff7fc5740 (LWP 29030) main () at foo.c:92
  (gdb)

  (gdb) info inferiors 
    Num  Description       Executable        
    1    process 5473      /home/pedro/gdb/tests/threads 
  * 2    process 5477      /home/pedro/gdb/tests/main 
  (gdb)

  (gdb) info checkpoints
    3 process 29132 at 0x4008ad, file foo.c, line 81
    2 process 29131 at 0x4008ad, file foo.c, line 81
    1 process 29130 at 0x4008ad, file foo.c, line 81
  * 0 Thread 0x7ffff7fc5740 (LWP 29128) (main process) at 0x4008ad, file foo.c, line 81
  (gdb)

This patch series switches all "descending order" commands I found to
ascending order, and adjusts manual and testsuite accordingly.

Pedro Alves (6):
  Make gdb.python/py-inferior.exp test names unique
  Linux: dump the signalled thread first
  List inferiors/threads/pspaces in ascending order
  List checkpoints in ascending order
  List displays in ascending order
  NEWS: "info" commands now list in ascending order

 gdb/NEWS                                           |   4 +
 gdb/doc/gdb.texinfo                                |   8 +-
 gdb/inferior.c                                     |  13 +-
 gdb/linux-fork.c                                   |  35 +++-
 gdb/linux-tdep.c                                   | 126 ++++++------
 gdb/printcmd.c                                     |  14 +-
 gdb/progspace.c                                    |  12 +-
 gdb/testsuite/gdb.base/checkpoint.exp              |   4 +-
 gdb/testsuite/gdb.base/display.exp                 |  35 +++-
 gdb/testsuite/gdb.base/foll-exec-mode.exp          |   2 +-
 gdb/testsuite/gdb.base/foll-fork.exp               |   6 +-
 gdb/testsuite/gdb.base/foll-vfork.exp              |   2 +-
 gdb/testsuite/gdb.base/multi-forks.exp             |  30 +--
 gdb/testsuite/gdb.base/solib-display.exp           |  19 +-
 gdb/testsuite/gdb.mi/mi-nonstop.exp                |   2 +-
 gdb/testsuite/gdb.mi/mi-nsintrall.exp              |   4 +-
 gdb/testsuite/gdb.multi/base.exp                   |  18 +-
 gdb/testsuite/gdb.multi/multi-arch.exp             |   2 +-
 gdb/testsuite/gdb.python/py-inferior.exp           | 217 ++++++++++----------
 gdb/testsuite/gdb.threads/break-while-running.exp  |   8 +-
 gdb/testsuite/gdb.threads/execl.exp                |   2 +-
 gdb/testsuite/gdb.threads/gcore-thread.exp         |   4 +-
 gdb/testsuite/gdb.threads/info-threads-cur-sal.exp |  10 +-
 gdb/testsuite/gdb.threads/kill.exp                 |   2 +-
 gdb/testsuite/gdb.threads/linux-dp.exp             |   2 +-
 gdb/testsuite/gdb.threads/multiple-step-overs.exp  |   2 +-
 gdb/testsuite/gdb.threads/next-bp-other-thread.exp |   2 +-
 .../gdb.threads/step-bg-decr-pc-switch-thread.exp  |   2 +-
 .../gdb.threads/step-over-lands-on-breakpoint.exp  |   2 +-
 .../gdb.threads/step-over-trips-on-watchpoint.exp  |   2 +-
 gdb/testsuite/gdb.threads/thread-find.exp          | 218 ++++-----------------
 gdb/testsuite/gdb.threads/tls.exp                  |   2 +-
 gdb/testsuite/lib/mi-support.exp                   |  13 +-
 gdb/thread.c                                       |  13 +-
 34 files changed, 394 insertions(+), 443 deletions(-)

-- 
1.9.3


             reply	other threads:[~2015-10-22  9:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 10:56 Pedro Alves [this message]
2015-10-22 10:57 ` [PATCH 4/6] List checkpoints in ascending order Pedro Alves
2015-10-22 10:58 ` [PATCH 2/6] Linux: dump the signalled thread first Pedro Alves
2015-10-22 11:07 ` [PATCH 3/6] List inferiors/threads/pspaces in ascending order Pedro Alves
2015-10-22 16:03   ` Eli Zaretskii
2016-01-08 20:39   ` Regression for gdb.threads/fork-plus-threads.exp [Re: [PATCH 3/6] List inferiors/threads/pspaces in ascending order] Jan Kratochvil
2016-01-11 14:40     ` Pedro Alves
2016-01-12 11:22       ` Pedro Alves
2016-01-13  0:37         ` Pedro Alves
2015-10-22 11:23 ` [PATCH 1/6] Make gdb.python/py-inferior.exp test names unique Pedro Alves
2015-10-22 11:50 ` [PATCH 6/6] NEWS: "info" commands now list in ascending order Pedro Alves
2015-10-22 16:00   ` Eli Zaretskii
2015-10-22 16:06     ` Pedro Alves
2015-10-22 16:16       ` Eli Zaretskii
2015-10-22 12:36 ` [PATCH 5/6] List displays " Pedro Alves
2015-11-24 18:44 ` [PATCH 0/6] PR 17539 - inferiors/threads etc. print in reverse order Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445507944-9197-1-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox