Re: [PATCH v2] Show the selected frame in "bt"

Philippe Waroquiers <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
On Sun, 2026-07-05 at 06:26 -0600, 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.
Maybe you could instead replace the # by a * for the selected frame so as to have:

(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

Philippe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.