RE: [PATCH v2] Show the selected frame in "bt"
"Joos, Christina" <[email protected]>
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <SN7PR11MB763826FDC218841CB6473EA889DE2@SN7PR11MB7638.namprd11.prod.outlook.com> |
Hi Tom, Thank you for this patch. > -----Original Message----- > From: Tom Tromey <[email protected]> > Sent: Sonntag, 5. Juli 2026 14:26 > To: [email protected] > Cc: Tom Tromey <[email protected]> > Subject: [PATCH v2] Show the selected frame in "bt" > > 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 am not sure if this is helpful but out of curiosity, I looked at the bt output when using lldb: ~~~ (lldb) bt * thread #1, name = 'main', stop reason = breakpoint 1.1 * frame #0: 0x0000555555555130 main`main frame #1: 0x00007ffff7c2a601 libc.so.6`__libc_start_call_main(main=(main`main), argc=1, argv=0x00007fffffffe868) at libc_start_call_main.h:59:16 frame #2: 0x00007ffff7c2a718 libc.so.6`__libc_start_main_impl(main=(main`main), argc=1, argv=0x00007fffffffe868, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffe858) at libc-start.c:360:3 frame #3: 0x0000555555555065 main`_start + 37 (lldb) up frame #1: 0x00007ffff7c2a601 libc.so.6`__libc_start_call_main(main=(main`main), argc=1, argv=0x00007fffffffe868) at libc_start_call_main.h:59:16 (lldb) bt * thread #1, name = 'main', stop reason = breakpoint 1.1 frame #0: 0x0000555555555130 main`main * frame #1: 0x00007ffff7c2a601 libc.so.6`__libc_start_call_main(main=(main`main), argc=1, argv=0x00007fffffffe868) at libc_start_call_main.h:59:16 frame #2: 0x00007ffff7c2a718 libc.so.6`__libc_start_main_impl(main=(main`main), argc=1, argv=0x00007fffffffe868, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffe858) at libc-start.c:360:3 frame #3: 0x0000555555555065 main`_start + 37 ~~~ So, lldb also uses '*' and accepts the additional horizontal space. IMO this should be fine for GDB, too. Maybe it is better to improve the settings in backtrace command (of course, not necessarily as part of this patch-series) to make easier to shorten the output ? One possibility is making "(gdb) set print address off" part of the backtrace command line options. On the other hand, the bt command already has so many settings... And I personally find the " -frame-info" options not too straight forward to understand. For your patch I noticed that you don't print the selected frame for the 'source-line' config: ~~~ (gdb) bt -frame-info source-line 0x0000000000401153 21 A<int> a; (gdb) bt * #0 0x0000000000401153 in main () at main.cc:21 ~~~ Is this intended? Please find one more comment for the code below. > Compared to v1, this version just fixes the test suite. Note that > there may be other tests that need updating but that I couldn't test. > > Regression tested on x86-64 Fedora 40. > --- > gdb/NEWS | 3 + > gdb/doc/gdb.texinfo | 62 ++-- > gdb/extension-priv.h | 3 +- > gdb/extension.c | 8 +- > gdb/extension.h | 3 +- > gdb/frame.h | 3 +- > gdb/gstack-1.in | 2 +- > gdb/mi/mi-cmd-stack.c | 8 +- > gdb/python/py-framefilter.c | 18 +- > gdb/python/python-internal.h | 3 +- > gdb/stack.c | 39 ++- > .../gdb.ada/out_of_line_in_inlined.exp | 6 +- > gdb/testsuite/gdb.arch/amd64-entry-value.exp | 52 +-- > .../gdb.arch/amd64-invalid-stack-middle.exp | 4 +- > .../gdb.arch/amd64-invalid-stack-top.exp | 4 +- > gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp | 2 +- > .../gdb.arch/amd64-tailcall-noret.exp | 2 +- > .../gdb.arch/amd64-tailcall-self.exp | 2 +- > .../gdb.arch/i386-attach-see-vdso.exp | 2 +- > gdb/testsuite/gdb.arch/i386-signal.exp | 2 +- > gdb/testsuite/gdb.base/annota1.exp | 6 +- > .../gdb.base/backtrace-through-cu-nodebug.exp | 8 +- > gdb/testsuite/gdb.base/backtrace.exp | 16 +- > .../gdb.base/bad-frame-selection.exp | 16 +- > gdb/testsuite/gdb.base/break-interp.exp | 6 +- > gdb/testsuite/gdb.base/break.exp | 4 +- > gdb/testsuite/gdb.base/bt-selected-frame.exp | 12 +- > gdb/testsuite/gdb.base/dfp-test.exp | 6 +- > gdb/testsuite/gdb.base/frame-args.exp | 2 +- > gdb/testsuite/gdb.base/frame-selection.exp | 6 +- > gdb/testsuite/gdb.base/funcargs.exp | 316 +++++++++--------- > gdb/testsuite/gdb.base/gcore.exp | 18 +- > gdb/testsuite/gdb.base/gdb1250.exp | 4 +- > gdb/testsuite/gdb.base/gstack.exp | 2 +- > gdb/testsuite/gdb.base/hbreak2.exp | 6 +- > .../gdb.base/inline-frame-cycle-unwind.exp | 38 +-- > gdb/testsuite/gdb.base/jit-reader.exp | 16 +- > gdb/testsuite/gdb.base/large-frame.exp | 6 +- > gdb/testsuite/gdb.base/pc-not-saved.exp | 6 +- > gdb/testsuite/gdb.base/readnever.exp | 8 +- > gdb/testsuite/gdb.base/recpar.exp | 2 +- > gdb/testsuite/gdb.base/sepdebug.exp | 6 +- > gdb/testsuite/gdb.base/sigaltstack.exp | 16 +- > gdb/testsuite/gdb.base/siginfo.exp | 6 +- > gdb/testsuite/gdb.base/sigstep.exp | 18 +- > gdb/testsuite/gdb.base/tailcall-msym.exp | 6 +- > gdb/testsuite/gdb.base/until-in-tailcall.exp | 6 +- > .../gdb.base/unwind-on-each-insn.exp.tcl | 2 +- > gdb/testsuite/gdb.btrace/record_goto.exp | 6 +- > gdb/testsuite/gdb.btrace/tailcall.exp | 6 +- > gdb/testsuite/gdb.compile/compile-cplus.exp | 2 +- > gdb/testsuite/gdb.cp/exception.exp | 8 +- > gdb/testsuite/gdb.cp/expand-sals.exp | 2 +- > gdb/testsuite/gdb.cp/pass-by-ref-2.exp | 8 +- > .../gdb.dwarf2/debug-frame-no-cfa.exp | 2 +- > gdb/testsuite/gdb.dwarf2/debug-frame.exp | 2 +- > gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 12 +- > gdb/testsuite/gdb.dwarf2/dw2-inline-bt.exp | 4 +- > .../gdb.dwarf2/dw2-inline-many-frames.exp | 24 +- > gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp | 2 +- > gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp | 8 +- > gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp | 8 +- > .../gdb.dwarf2/dw2-reg-undefined.exp | 2 +- > gdb/testsuite/gdb.dwarf2/dw2-restore.exp | 2 +- > .../gdb.dwarf2/dw2-wrong-mangled-name.exp | 4 +- > gdb/testsuite/gdb.fortran/backtrace.exp | 6 +- > .../gdb.fortran/mixed-lang-stack.exp | 20 +- > gdb/testsuite/gdb.opt/empty-inline-cxx.exp | 14 +- > gdb/testsuite/gdb.opt/inline-bt.exp | 6 +- > .../gdb.python/pretty-print-call-by-hand.exp | 24 +- > .../py-finish-breakpoint-tailcall.exp | 6 +- > .../gdb.python/py-framefilter-addr.exp | 16 +- > .../gdb.python/py-inf-exited-at-exit.exp | 4 +- > .../gdb.python/py-pending-frame-level.exp | 20 +- > .../gdb.python/py-recurse-unwind.exp | 8 +- > gdb/testsuite/gdb.python/py-unwind-inline.exp | 4 +- > gdb/testsuite/gdb.python/py-unwind-maint.exp | 2 +- > .../gdb.python/py-unwind-user-regs.exp | 14 +- > gdb/testsuite/gdb.python/py-unwind.exp | 10 +- > .../gdb.threads/pthread_cond_wait.exp | 2 +- > gdb/testsuite/gdb.trace/entry-values.exp | 14 +- > 81 files changed, 552 insertions(+), 512 deletions(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index 343828a85dd..2e15ff06e32 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -3,6 +3,9 @@ > > *** Changes since GDB 17 > > +* GDB now shows a "*" marker next to the currently selected frame in a > + backtrace. > + > * Support for the Common Trace Format (CTF) has been removed. GDB now > saves trace information exclusively in its own "tfile" format. > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index a698b2b8451..9f8067f1669 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -707,15 +707,15 @@ stack frame for each active subroutine. > > @smallexample > (@value{GDBP}) @b{bt} > -#0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>") > +* #0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>") > at input.c:530 > -#1 0x6344 in m4_changequote (argc=3, argv=0x33c70) > + #1 0x6344 in m4_changequote (argc=3, argv=0x33c70) > at builtin.c:882 > -#2 0x8174 in expand_macro (sym=0x33320) at macro.c:242 > -#3 0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30) > + #2 0x8174 in expand_macro (sym=0x33320) at macro.c:242 > + #3 0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30) > at macro.c:71 > -#4 0x79dc in expand_input () at macro.c:40 > -#5 0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195 > + #4 0x79dc in expand_input () at macro.c:40 > + #5 0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195 > @end smallexample > > @noindent > @@ -13589,13 +13589,13 @@ Example: > > @smallexample > (@value{GDBP}) backtrace > -#0 bottom_func () > +* #0 bottom_func () > at testsuite/gdb.python/py-caller-is.c:21 > -#1 0x00000000004005a0 in middle_func () > + #1 0x00000000004005a0 in middle_func () > at testsuite/gdb.python/py-caller-is.c:27 > -#2 0x00000000004005ab in top_func () > + #2 0x00000000004005ab in top_func () > at testsuite/gdb.python/py-caller-is.c:33 > -#3 0x00000000004005b6 in main () > + #3 0x00000000004005b6 in main () > at testsuite/gdb.python/py-caller-is.c:39 > (@value{GDBP}) print $_caller_is ("middle_func") > $1 = 1 > @@ -14961,8 +14961,8 @@ DW_TAG_call_site 0x40039a in main > a () at t.c:3 > 3 static void __attribute__((noinline, noclone)) a (void) @{ x++; @} > (@value{GDBP}) bt > -#0 a () at t.c:3 > -#1 0x000000000040039a in main () at t.c:5 > +* #0 a () at t.c:3 > + #1 0x000000000040039a in main () at t.c:5 > @end smallexample > > Another possibility is an ambiguous virtual tail call frames resolution: > @@ -14982,9 +14982,9 @@ tailcall: initial: 0x4004d2(a) 0x4004ce(b) > 0x4004b2(c) 0x4004a2(d) > tailcall: compare: 0x4004d2(a) 0x4004cc(b) 0x400492(e) > tailcall: reduced: 0x4004d2(a) | > (@value{GDBP}) bt > -#0 f () at t.c:2 > -#1 0x00000000004004d2 in a () at t.c:8 > -#2 0x0000000000400395 in main () at t.c:9 > +* #0 f () at t.c:2 > + #1 0x00000000004004d2 in a () at t.c:8 > + #2 0x0000000000400395 in main () at t.c:9 > @end smallexample > > @set CALLSEQ1A > @code{main@value{ARROW}a@value{ARROW}b@value{ARROW}c@value{ARR > OW}d@value{ARROW}f} > @@ -15032,11 +15032,11 @@ static void __attribute__((noinline, noclone)) a > (int i) > int main (void) @{ a (5); return 0; @} > > (@value{GDBP}) bt > -#0 c (i=i@@entry=0) at t.c:2 > -#1 0x0000000000400428 in a (DW_OP_entry_value resolving has found > -function "a" at 0x400420 can call itself via tail calls > -i=<optimized out>) at t.c:6 > -#2 0x000000000040036e in main () at t.c:7 > +* #0 c (i=i@@entry=0) at t.c:2 > + #1 0x0000000000400428 in a (DW_OP_entry_value resolving has found > + function "a" at 0x400420 can call itself via tail calls > + i=<optimized out>) at t.c:6 > + #2 0x000000000040036e in main () at t.c:7 > @end smallexample > > @value{GDBN} cannot find out from the inferior state if and how many times > did > @@ -19672,11 +19672,11 @@ from the current task to the given task. > [Switching to task 1 "main_task"] > #0 0x8067726 in pthread_cond_wait () > (@value{GDBP}) bt > -#0 0x8067726 in pthread_cond_wait () > -#1 0x8056714 in system.os_interface.pthread_cond_wait () > -#2 0x805cb63 in system.task_primitives.operations.sleep () > -#3 0x806153e in system.tasking.stages.activate_tasks () > -#4 0x804aacc in un () at un.adb:5 > +* #0 0x8067726 in pthread_cond_wait () > + #1 0x8056714 in system.os_interface.pthread_cond_wait () > + #2 0x805cb63 in system.task_primitives.operations.sleep () > + #3 0x806153e in system.tasking.stages.activate_tasks () > + #4 0x804aacc in un () at un.adb:5 > @end smallexample > > @item task apply [@var{task-id-list} | all] [@var{flag}]@dots{} > @var{command} > @@ -21394,12 +21394,12 @@ backtrace, for example frame @code{#3} in > the following backtrace: > > @smallexample > (@value{GDBP}) backtrace > -#0 0x00007ffff7b3d1e7 in nanosleep () from /lib64/libc.so.6 > -#1 0x00007ffff7b3d11e in sleep () from /lib64/libc.so.6 > -#2 0x000000000040113f in deadlock () at test.cc:13 > -#3 <function called from gdb> > -#4 breakpt () at test.cc:20 > -#5 0x0000000000401151 in main () at test.cc:25 > +* #0 0x00007ffff7b3d1e7 in nanosleep () from /lib64/libc.so.6 > + #1 0x00007ffff7b3d11e in sleep () from /lib64/libc.so.6 > + #2 0x000000000040113f in deadlock () at test.cc:13 > + #3 <function called from gdb> > + #4 breakpt () at test.cc:20 > + #5 0x0000000000401151 in main () at test.cc:25 > @end smallexample > > At this point it is possible to examine the state of the inferior just > diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h > index 4ef87415413..9b0c4815399 100644 > --- a/gdb/extension-priv.h > +++ b/gdb/extension-priv.h > @@ -186,7 +186,8 @@ struct extension_language_ops > (const struct extension_language_defn *, > const frame_info_ptr &frame, frame_filter_flags flags, > enum ext_lang_frame_args args_type, > - struct ui_out *out, int frame_low, int frame_high); > + struct ui_out *out, int frame_low, int frame_high, > + const frame_info_ptr &selected_frame); > > /* Used for registering the ptwrite filter to the current thread. */ > void (*apply_ptwrite_filter) > diff --git a/gdb/extension.c b/gdb/extension.c > index d8ef8123ab5..a57ad4a517a 100644 > --- a/gdb/extension.c > +++ b/gdb/extension.c > @@ -521,7 +521,8 @@ apply_ext_lang_frame_filter (const frame_info_ptr > &frame, > frame_filter_flags flags, > enum ext_lang_frame_args args_type, > struct ui_out *out, > - int frame_low, int frame_high) > + int frame_low, int frame_high, > + const frame_info_ptr &selected_frame) > { > for (const struct extension_language_defn *extlang : extension_languages) > { > @@ -531,8 +532,9 @@ apply_ext_lang_frame_filter (const frame_info_ptr > &frame, > || extlang->ops->apply_frame_filter == NULL) > continue; > status = extlang->ops->apply_frame_filter (extlang, frame, flags, > - args_type, out, > - frame_low, frame_high); > + args_type, out, > + frame_low, frame_high, > + selected_frame); > /* We use the filters from the first extension language that has > applicable filters. Also, an error is reported immediately > rather than continue trying. */ > diff --git a/gdb/extension.h b/gdb/extension.h > index b7bbf2a502d..a328fbe8540 100644 > --- a/gdb/extension.h > +++ b/gdb/extension.h > @@ -302,7 +302,8 @@ extern int apply_ext_lang_val_pretty_printer > extern enum ext_lang_bt_status apply_ext_lang_frame_filter > (const frame_info_ptr &frame, frame_filter_flags flags, > enum ext_lang_frame_args args_type, > - struct ui_out *out, int frame_low, int frame_high); > + struct ui_out *out, int frame_low, int frame_high, > + const frame_info_ptr &selected_frame); > > extern void apply_ext_lang_ptwrite_filter > (struct btrace_thread_info *btinfo); > diff --git a/gdb/frame.h b/gdb/frame.h > index f6553fb7b6d..0f63e6eaab8 100644 > --- a/gdb/frame.h > +++ b/gdb/frame.h > @@ -904,7 +904,8 @@ extern void print_stack_frame (const frame_info_ptr > &, int print_level, > extern void print_frame_info (const frame_print_options &fp_opts, > const frame_info_ptr &, int print_level, > enum print_what print_what, int args, > - int set_current_sal); > + int set_current_sal, > + const frame_info_ptr &selected_frame); > > extern frame_info_ptr block_innermost_frame (const struct block *); > > diff --git a/gdb/gstack-1.in b/gdb/gstack-1.in > index 9079e70a746..e0de9729ccf 100755 > --- a/gdb/gstack-1.in > +++ b/gdb/gstack-1.in > @@ -109,7 +109,7 @@ BEGIN { > attach_okay=1 > } > > -/^#/ { > +/^..#/ { > if (attach_okay) { > print \$0 > } > diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c > index 280a08d121e..8623b9d3cfa 100644 > --- a/gdb/mi/mi-cmd-stack.c > +++ b/gdb/mi/mi-cmd-stack.c > @@ -67,7 +67,7 @@ mi_apply_ext_lang_frame_filter (const frame_info_ptr > &frame, > return apply_ext_lang_frame_filter (frame, flags, > (enum ext_lang_frame_args) print_values, > out, > - frame_low, frame_high); > + frame_low, frame_high, {}); > } > > /* Print a list of the stack frames. Args can be none, in which case > @@ -158,7 +158,7 @@ mi_cmd_stack_list_frames (const char *command, > const char *const *argv, > > result = apply_ext_lang_frame_filter (get_current_frame (), flags, > NO_VALUES, current_uiout, > - py_frame_low, frame_high); > + py_frame_low, frame_high, {}); > } > > /* Run the inbuilt backtrace if there are no filters registered, or > @@ -175,7 +175,7 @@ mi_cmd_stack_list_frames (const char *command, > const char *const *argv, > /* Print the location and the address always, even for level 0. > If args is 0, don't print the arguments. */ > print_frame_info (user_frame_print_options, > - fi, 1, LOC_AND_ADDRESS, 0 /* args */, 0); > + fi, 1, LOC_AND_ADDRESS, 0 /* args */, 0, {}); > } > } > } > @@ -762,5 +762,5 @@ mi_cmd_stack_info_frame (const char *command, > const char *const *argv, > error (_("-stack-info-frame: No arguments allowed")); > > print_frame_info (user_frame_print_options, > - get_selected_frame (), 1, LOC_AND_ADDRESS, 0, 1); > + get_selected_frame (), 1, LOC_AND_ADDRESS, 0, 1, {}); > } > diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c > index f256a26807c..11463746787 100644 > --- a/gdb/python/py-framefilter.c > +++ b/gdb/python/py-framefilter.c > @@ -761,7 +761,8 @@ static enum ext_lang_bt_status > py_print_frame (PyObject *filter, frame_filter_flags flags, > enum ext_lang_frame_args args_type, > struct ui_out *out, int indent, > - levels_printed_hash &levels_printed) > + levels_printed_hash &levels_printed, > + const frame_info_ptr &selected_frame) > { > int has_addr = 0; > CORE_ADDR address = 0; > @@ -865,6 +866,14 @@ py_print_frame (PyObject *filter, frame_filter_flags > flags, > || print_what == LOC_AND_ADDRESS > || print_what == SHORT_LOCATION)); > > + if (!selected_frame.is_null ()) > + { > + if (frame == selected_frame) > + out->text ("* "); > + else > + out->text (" "); > + } > + > /* Print frame level. MI does not require the level if > locals/variables only are being printed. */ > if (print_level > @@ -1068,7 +1077,7 @@ py_print_frame (PyObject *filter, frame_filter_flags > flags, > > enum ext_lang_bt_status success > = py_print_frame (item, flags, args_type, out, indent, > - levels_printed); > + levels_printed, selected_frame); > > if (success == EXT_LANG_BT_ERROR) > return EXT_LANG_BT_ERROR; > @@ -1142,7 +1151,8 @@ enum ext_lang_bt_status > gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, > const frame_info_ptr &frame, frame_filter_flags > flags, > enum ext_lang_frame_args args_type, > - struct ui_out *out, int frame_low, int frame_high) > + struct ui_out *out, int frame_low, int frame_high, > + const frame_info_ptr &selected_frame) > { > struct gdbarch *gdbarch = NULL; > enum ext_lang_bt_status success = EXT_LANG_BT_ERROR; > @@ -1234,7 +1244,7 @@ gdbpy_apply_frame_filter (const struct > extension_language_defn *extlang, > try > { > success = py_print_frame (item.get (), flags, args_type, out, 0, > - levels_printed); > + levels_printed, selected_frame); > } > catch (const gdb_exception_error &except) > { > diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h > index 4ca28bb6957..7d2d91ae9f3 100644 > --- a/gdb/python/python-internal.h > +++ b/gdb/python/python-internal.h > @@ -444,7 +444,8 @@ extern enum ext_lang_bt_status > gdbpy_apply_frame_filter > (const struct extension_language_defn *, > const frame_info_ptr &frame, frame_filter_flags flags, > enum ext_lang_frame_args args_type, > - struct ui_out *out, int frame_low, int frame_high); > + struct ui_out *out, int frame_low, int frame_high, > + const frame_info_ptr &selected_frame); > extern void gdbpy_preserve_values (const struct extension_language_defn *, > struct objfile *objfile, > copied_types_hash_t &copied_types); > diff --git a/gdb/stack.c b/gdb/stack.c > index e084976eabf..3d50a68ef50 100644 > --- a/gdb/stack.c > +++ b/gdb/stack.c > @@ -227,7 +227,8 @@ static void print_frame (struct ui_out *uiout, > const frame_print_options &opts, > const frame_info_ptr &frame, int print_level, > enum print_what print_what, int print_args, > - struct symtab_and_line sal); > + struct symtab_and_line sal, > + const frame_info_ptr &selected_frame); > static frame_info_ptr find_frame_for_function (const char *); > static frame_info_ptr find_frame_for_address (CORE_ADDR); > @@ -362,7 +363,7 @@ print_stack_frame (const frame_info_ptr &frame, int > print_level, > { > print_frame_info (user_frame_print_options, > frame, print_level, print_what, 1 /* print_args */, > - set_current_sal); > + set_current_sal, {}); > if (set_current_sal) > set_current_sal_from_frame (frame); > } > @@ -961,7 +962,7 @@ static void > do_print_frame_info (struct ui_out *uiout, const frame_print_options > &fp_opts, > const frame_info_ptr &frame, int print_level, > enum print_what print_what, int print_args, > - int set_current_sal) > + int set_current_sal, const frame_info_ptr &selected_frame) Would it be an option to pass the selected frame id only? Christina ________________________________________ Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 (89) 99143-0 www.intel.de Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.