The function will be used in a later patch "gdb: Implement 'bt shadow' to print the shadow stack backtrace.". Approved-By: Tom Tromey --- gdb/stack.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/stack.c b/gdb/stack.c index 54935992ebf..ffca1cb0865 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -983,15 +983,14 @@ print_frame_info_to_print_what (const char *print_frame_info) print_frame_info); } -/* Print the PC from FRAME, plus any flags, to UIOUT. */ +/* Print the PC, plus any FLAGS (if non-empty), to UIOUT. */ static void -print_pc (struct ui_out *uiout, struct gdbarch *gdbarch, const frame_info_ptr &frame, +print_pc (ui_out *uiout, gdbarch *gdbarch, const std::string &flags, CORE_ADDR pc) { uiout->field_core_addr ("addr", gdbarch, pc); - std::string flags = gdbarch_get_pc_address_flags (gdbarch, frame, pc); if (!flags.empty ()) { uiout->text (" ["); @@ -1000,6 +999,16 @@ print_pc (struct ui_out *uiout, struct gdbarch *gdbarch, const frame_info_ptr &f } } +/* Print the PC from FRAME, plus any flags, to UIOUT. */ + +static void +print_pc (ui_out *uiout, gdbarch *gdbarch, const frame_info_ptr &frame, + CORE_ADDR pc) +{ + std::string flags = gdbarch_get_pc_address_flags (gdbarch, frame, pc); + print_pc (uiout, gdbarch, flags, pc); +} + /* See stack.h. */ void -- 2.34.1