Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFC] Show the selected frame in "bt"
Date: Fri, 29 May 2026 15:05:40 -0400	[thread overview]
Message-ID: <a08d5efb-0f41-498f-b8ee-0bc5f5808046@simark.ca> (raw)
In-Reply-To: <20260529184503.3263361-1-tom@tromey.com>

On 5/29/26 2:45 PM, Tom Tromey wrote:
> I've occasionally wished that "bt" would indicate the selected frame.
> This patch implements this idea.  In particular it marks the selected
> frame with "*", similar to other "selected" output in gdb.  (See that
> other series where emoji were allowed in the "current" column of a
> table; if that is ever resurrected, I'd expect the same treatment to
> be applied here.)
> 
> Now the output looks like:
> 
> (gdb) bt
>   #0  0x00007ffff6e381fd in poll () from /lib64/libc.so.6
>   #1  0x000000000100b1ee in gdb_wait_for_event (block=1) at ../../binutils-gdb/gdbsupport/event-loop.cc:587
>   #2  0x000000000100a77f in gdb_do_one_event (mstimeout=-1) at ../../binutils-gdb/gdbsupport/event-loop.cc:263
> * #3  0x00000000007d2c6a in interp::do_one_event (this=<optimized out>, mstimeout=-1) at ../../binutils-gdb/gdb/interps.h:90
>   #4  start_event_loop () at ../../binutils-gdb/gdb/main.c:400
>   #5  captured_command_loop () at ../../binutils-gdb/gdb/main.c:465
>   #6  0x00000000007d5715 in captured_main (context=context@entry=0x7fffffffdd10) at ../../binutils-gdb/gdb/main.c:1373
>   #7  gdb_main (args=args@entry=0x7fffffffdd50) at ../../binutils-gdb/gdb/main.c:1392
>   #8  0x0000000000452cd5 in main (argc=1, argv=0x7fffffffdea8) at ../../binutils-gdb/gdb/gdb.c:38
> 
> I think the main downside of this patch is that it uses a little more
> horizontal space for the indicator.

I like it, it fits well in the "show user what is selected" paradigm.

If we're talking about bt formatting and horizontal space, we could
consider not showing addresses by default, I bet that most users don't
care.  I find it ugly that by default the address is shown for some
frames but not all, it makes things unaligned (you can force GDB to show
addresses with `-frame-info location-and-address` though).  I don't know
if there is currently a setting to make GDB show the function name but
not the address.

Simon

  reply	other threads:[~2026-05-29 19:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 18:45 Tom Tromey
2026-05-29 19:05 ` Simon Marchi [this message]
2026-06-01  7:05   ` Schimpe, Christina

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=a08d5efb-0f41-498f-b8ee-0bc5f5808046@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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