diff options
author | Tom Tromey <tromey@adacore.com> | 2023-03-22 10:51:50 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-04-07 09:17:55 -0600 |
commit | b4614d1090dd92cfd64a687b090cb4d5e13aced0 (patch) | |
tree | 6e088c37b92e1d3a31d99fcf963acccae26c80e5 /gdb/frame-unwind.c | |
parent | 31c502801798f397d6ec44d081350c704ca4a901 (diff) | |
download | fsf-binutils-gdb-b4614d1090dd92cfd64a687b090cb4d5e13aced0.zip fsf-binutils-gdb-b4614d1090dd92cfd64a687b090cb4d5e13aced0.tar.gz fsf-binutils-gdb-b4614d1090dd92cfd64a687b090cb4d5e13aced0.tar.bz2 |
Use ui_out for "maint info frame-unwinders"
This changes "maint info frame-unwinders" to use ui-out. This makes
the table slightly nicer. In general I think it's better to use
ui-out for tables.
Diffstat (limited to 'gdb/frame-unwind.c')
-rw-r--r-- | gdb/frame-unwind.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index a3673dd..866b2e6 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -347,13 +347,22 @@ maintenance_info_frame_unwinders (const char *args, int from_tty) struct gdbarch *gdbarch = target_gdbarch (); struct frame_unwind_table *table = get_frame_unwind_table (gdbarch); + ui_out *uiout = current_uiout; + ui_out_emit_table table_emitter (uiout, 2, -1, "FrameUnwinders"); + uiout->table_header (27, ui_left, "name", "Name"); + uiout->table_header (25, ui_left, "type", "Type"); + uiout->table_body (); + for (struct frame_unwind_table_entry *entry = table->list; entry != NULL; entry = entry->next) { const char *name = entry->unwinder->name; const char *type = frame_type_str (entry->unwinder->type); - gdb_printf (gdb_stdout, "%-16s\t%-16s\n", name, type); + ui_out_emit_list tuple_emitter (uiout, nullptr); + uiout->field_string ("name", name); + uiout->field_string ("type", type); + uiout->text ("\n"); } } |