Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Schimpe, Christina" <christina.schimpe@intel.com>
To: Simon Marchi <simark@simark.ca>, Tom Tromey <tom@tromey.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [RFC] Show the selected frame in "bt"
Date: Mon, 1 Jun 2026 07:05:20 +0000	[thread overview]
Message-ID: <SN7PR11MB763844B285FA1356CA9283E9F9152@SN7PR11MB7638.namprd11.prod.outlook.com> (raw)
In-Reply-To: <a08d5efb-0f41-498f-b8ee-0bc5f5808046@simark.ca>

> -----Original Message-----
> From: Simon Marchi <simark@simark.ca>
> Sent: Freitag, 29. Mai 2026 21:06
> To: Tom Tromey <tom@tromey.com>; gdb-patches@sourceware.org
> Subject: Re: [RFC] Show the selected frame in "bt"
> 
> 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.

That the bt command only shows the address for some frames but not for all of them
used to confuse me, too. 
Hiding the address is possible with "set print address off", but I doubt that users
can find this easily since it's not part of the backtrace help text.

I personally like that we show the selected frame - and since I am working on
"bt -shadow" I wonder if it makes sense to integrate that in this output, too.

Currently for "bt -shadow" we don't have the frame #0 which is shown in the
normal backtrace - so we cannot always show the selected frame in "bt shadow".
It has also been discussed to add this frame or to simply start the "bt -shadow"
frame numbering with #1, so that the frame numbers are at least a bit more aligned.
This is one of the opens left for this series.

In any case, if we don't have frame #0 as in the normal bt, I am not sure if showing
the selected frame makes sense for "bt -shadow".

Christina


Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

      reply	other threads:[~2026-06-01  7:07 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
2026-06-01  7:05   ` Schimpe, Christina [this message]

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=SN7PR11MB763844B285FA1356CA9283E9F9152@SN7PR11MB7638.namprd11.prod.outlook.com \
    --to=christina.schimpe@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --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