From 381befeedf9316991d47f4213850545a96593d23 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 17 Jul 2019 08:34:23 -0600 Subject: [PATCH] Rename field_int to field_signed This renames ui_out::field_int to field_signed, and field_fmt_int to field_fmt_signed; and changes the type of the "value" parameter from int to LONGEST. Tested by the buildbot. gdb/ChangeLog 2019-07-17 Tom Tromey * ui-out.h (class ui_out) : Rename. Change type of "value". * ui-out.c (ui_out::field_signed): Rename from field_int. Change type of "value". (ui_out::field_fmt_signed): Rename from field_fmt_int. Change type of "value". * tui/tui-out.h (class tui_ui_out) : Rename from do_field_int. Change type of "value". * tui/tui-out.c (tui_ui_out::do_field_signed): Rename from do_field_int. Change type of "value". * tracepoint.c (trace_status_mi, tfind_1) (print_one_static_tracepoint_marker): Update. * thread.c (print_thread_info_1, print_selected_thread_frame): Update. * stack.c (print_frame, print_frame_info): Update. * spu-tdep.c (info_spu_signal_command, info_spu_dma_cmdlist): Update. * source.c (print_source_lines_base): Update. * skip.c (info_skip_command): Update. * record-btrace.c (btrace_ui_out_decode_error) (btrace_call_history_src_line): Update. * python/py-framefilter.c (py_print_single_arg, py_print_frame): Update. * progspace.c (print_program_space): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Update. * mi/mi-out.h (class mi_ui_out) : Rename from do_field_int. Change type of "value". * mi/mi-out.c (mi_ui_out::do_table_begin) (mi_ui_out::do_table_header): Update. (mi_ui_out::do_field_signed): Rename from do_field_int. Change type of "value". * mi/mi-main.c (mi_cmd_thread_list_ids, print_one_inferior) (mi_cmd_data_list_changed_registers, output_register) (mi_cmd_data_read_memory, mi_load_progress) (mi_cmd_trace_frame_collected): Update. * mi/mi-interp.c (mi_on_normal_stop_1, mi_output_solib_attribs): Update. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create) (mi_cmd_var_delete, mi_cmd_var_info_num_children) (mi_cmd_var_list_children, varobj_update_one): Update. * mi/mi-cmd-stack.c (mi_cmd_stack_info_depth) (mi_cmd_stack_list_args, list_arg_or_local): Update. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Update. * inferior.c (print_inferior): Update. * gdb_bfd.c (print_one_bfd): Update. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * cli-out.h (class cli_ui_out) : Rename from do_field_int. Change type of "value". * cli-out.c (cli_ui_out::do_field_signed): Rename from do_field_int. Change type of "value". * breakpoint.c (watchpoint_check, print_breakpoint_location) (print_one_breakpoint_location, print_it_catch_fork) (print_one_catch_fork, print_it_catch_vfork) (print_one_catch_vfork, print_it_catch_solib) (print_it_catch_exec, print_it_ranged_breakpoint) (print_mention_watchpoint, print_mention_masked_watchpoint) (bkpt_print_it, update_static_tracepoint): Update. * break-catch-throw.c (print_it_exception_catchpoint): Update. * break-catch-syscall.c (print_it_catch_syscall): Update. * ada-tasks.c (print_ada_task_info): Update. * ada-lang.c (print_it_exception, print_mention_exception): Update. --- gdb/ChangeLog | 67 +++++++++++++++++++++++++++++++++++++ gdb/ada-lang.c | 4 +-- gdb/ada-tasks.c | 8 ++--- gdb/break-catch-syscall.c | 4 +-- gdb/break-catch-throw.c | 2 +- gdb/breakpoint.c | 50 +++++++++++++-------------- gdb/cli-out.c | 8 ++--- gdb/cli-out.h | 4 +-- gdb/darwin-nat-info.c | 4 +-- gdb/disasm.c | 2 +- gdb/gdb_bfd.c | 2 +- gdb/inferior.c | 6 ++-- gdb/mi/mi-cmd-file.c | 6 ++-- gdb/mi/mi-cmd-stack.c | 6 ++-- gdb/mi/mi-cmd-var.c | 26 +++++++------- gdb/mi/mi-interp.c | 8 ++--- gdb/mi/mi-main.c | 36 ++++++++++---------- gdb/mi/mi-out.c | 12 +++---- gdb/mi/mi-out.h | 4 +-- gdb/mi/mi-symbol-cmds.c | 2 +- gdb/progspace.c | 2 +- gdb/python/py-framefilter.c | 7 ++-- gdb/record-btrace.c | 6 ++-- gdb/skip.c | 2 +- gdb/source.c | 2 +- gdb/spu-tdep.c | 16 ++++----- gdb/stack.c | 10 +++--- gdb/thread.c | 10 +++--- gdb/tracepoint.c | 28 ++++++++-------- gdb/tui/tui-out.c | 6 ++-- gdb/tui/tui-out.h | 4 +-- gdb/ui-out.c | 10 +++--- gdb/ui-out.h | 12 +++---- 33 files changed, 220 insertions(+), 156 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 16d09dc9d40..701b2c90d04 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,70 @@ +2019-07-17 Tom Tromey + + * ui-out.h (class ui_out) : Rename. Change type of "value". + * ui-out.c (ui_out::field_signed): Rename from field_int. + Change type of "value". + (ui_out::field_fmt_signed): Rename from field_fmt_int. Change + type of "value". + * tui/tui-out.h (class tui_ui_out) : Rename from + do_field_int. Change type of "value". + * tui/tui-out.c (tui_ui_out::do_field_signed): Rename from + do_field_int. Change type of "value". + * tracepoint.c (trace_status_mi, tfind_1) + (print_one_static_tracepoint_marker): Update. + * thread.c (print_thread_info_1, print_selected_thread_frame): + Update. + * stack.c (print_frame, print_frame_info): Update. + * spu-tdep.c (info_spu_signal_command, info_spu_dma_cmdlist): + Update. + * source.c (print_source_lines_base): Update. + * skip.c (info_skip_command): Update. + * record-btrace.c (btrace_ui_out_decode_error) + (btrace_call_history_src_line): Update. + * python/py-framefilter.c (py_print_single_arg, py_print_frame): + Update. + * progspace.c (print_program_space): Update. + * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Update. + * mi/mi-out.h (class mi_ui_out) : Rename from + do_field_int. Change type of "value". + * mi/mi-out.c (mi_ui_out::do_table_begin) + (mi_ui_out::do_table_header): Update. + (mi_ui_out::do_field_signed): Rename from do_field_int. Change + type of "value". + * mi/mi-main.c (mi_cmd_thread_list_ids, print_one_inferior) + (mi_cmd_data_list_changed_registers, output_register) + (mi_cmd_data_read_memory, mi_load_progress) + (mi_cmd_trace_frame_collected): Update. + * mi/mi-interp.c (mi_on_normal_stop_1, mi_output_solib_attribs): + Update. + * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create) + (mi_cmd_var_delete, mi_cmd_var_info_num_children) + (mi_cmd_var_list_children, varobj_update_one): Update. + * mi/mi-cmd-stack.c (mi_cmd_stack_info_depth) + (mi_cmd_stack_list_args, list_arg_or_local): Update. + * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Update. + * inferior.c (print_inferior): Update. + * gdb_bfd.c (print_one_bfd): Update. + * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): + Update. + * darwin-nat-info.c (darwin_debug_regions_recurse): Update. + * cli-out.h (class cli_ui_out) : Rename from + do_field_int. Change type of "value". + * cli-out.c (cli_ui_out::do_field_signed): Rename from + do_field_int. Change type of "value". + * breakpoint.c (watchpoint_check, print_breakpoint_location) + (print_one_breakpoint_location, print_it_catch_fork) + (print_one_catch_fork, print_it_catch_vfork) + (print_one_catch_vfork, print_it_catch_solib) + (print_it_catch_exec, print_it_ranged_breakpoint) + (print_mention_watchpoint, print_mention_masked_watchpoint) + (bkpt_print_it, update_static_tracepoint): Update. + * break-catch-throw.c (print_it_exception_catchpoint): Update. + * break-catch-syscall.c (print_it_catch_syscall): Update. + * ada-tasks.c (print_ada_task_info): Update. + * ada-lang.c (print_it_exception, print_mention_exception): + Update. + 2019-07-17 Andrew Burgess PR breakpoints/24541 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index deb5099024e..7a5cc4272c6 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12465,7 +12465,7 @@ print_it_exception (enum ada_exception_catchpoint_kind ex, bpstat bs) uiout->text (b->disposition == disp_del ? "\nTemporary catchpoint " : "\nCatchpoint "); - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (", "); /* ada_exception_name_addr relies on the selected frame being the @@ -12603,7 +12603,7 @@ print_mention_exception (enum ada_exception_catchpoint_kind ex, uiout->text (b->disposition == disp_del ? _("Temporary catchpoint ") : _("Catchpoint ")); - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (": "); switch (ex) diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 71800d1167b..a6238887048 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -1086,7 +1086,7 @@ print_ada_task_info (struct ui_out *uiout, uiout->field_skip ("current"); /* Print the task number. */ - uiout->field_int ("id", taskno); + uiout->field_signed ("id", taskno); /* Print the Task ID. */ uiout->field_string ("task-id", phex_nz (task_info->task_id, @@ -1098,7 +1098,7 @@ print_ada_task_info (struct ui_out *uiout, thread_info *thread = find_thread_ptid (task_info->ptid); if (thread != NULL) - uiout->field_int ("thread-id", thread->global_num); + uiout->field_signed ("thread-id", thread->global_num); else /* This should never happen unless there is a bug somewhere, but be resilient when that happens. */ @@ -1108,12 +1108,12 @@ print_ada_task_info (struct ui_out *uiout, /* Print the ID of the parent task. */ parent_id = get_task_number_from_id (task_info->parent, inf); if (parent_id) - uiout->field_int ("parent-id", parent_id); + uiout->field_signed ("parent-id", parent_id); else uiout->field_skip ("parent-id"); /* Print the base priority of the task. */ - uiout->field_int ("priority", task_info->priority); + uiout->field_signed ("priority", task_info->priority); /* Print the task current state. */ if (task_info->caller_task) diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index cd4870f7f51..a165be62be1 100644 --- a/gdb/break-catch-syscall.c +++ b/gdb/break-catch-syscall.c @@ -205,7 +205,7 @@ print_it_catch_syscall (bpstat bs) : EXEC_ASYNC_SYSCALL_RETURN)); uiout->field_string ("disp", bpdisp_text (b->disposition)); } - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); if (last.kind == TARGET_WAITKIND_SYSCALL_ENTRY) uiout->text (" (call to syscall "); @@ -213,7 +213,7 @@ print_it_catch_syscall (bpstat bs) uiout->text (" (returned from syscall "); if (s.name == NULL || uiout->is_mi_like_p ()) - uiout->field_int ("syscall-number", last.value.syscall_number); + uiout->field_signed ("syscall-number", last.value.syscall_number); if (s.name != NULL) uiout->field_string ("syscall-name", s.name); diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 17e3d26d376..0677a55ee55 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -235,7 +235,7 @@ print_it_exception_catchpoint (bpstat bs) bp_temp = b->disposition == disp_del; uiout->text (bp_temp ? "Temporary catchpoint " : "Catchpoint "); - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text ((kind == EX_EVENT_THROW ? " (exception thrown), " : (kind == EX_EVENT_CATCH ? " (exception caught), " : " (exception rethrown), "))); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index b345379d9a7..e0c9aa460f1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4913,7 +4913,7 @@ watchpoint_check (bpstat bs) uiout->field_string ("reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_SCOPE)); uiout->text ("\nWatchpoint "); - uiout->field_int ("wpnum", b->number); + uiout->field_signed ("wpnum", b->number); uiout->text (" deleted because the program has left the block in\n" "which its expression is valid.\n"); } @@ -5836,7 +5836,7 @@ print_breakpoint_location (struct breakpoint *b, if (uiout->is_mi_like_p ()) uiout->field_string ("fullname", symtab_to_fullname (loc->symtab)); - uiout->field_int ("line", loc->line_number); + uiout->field_signed ("line", loc->line_number); } else if (loc) { @@ -6008,7 +6008,7 @@ print_one_breakpoint_location (struct breakpoint *b, if (part_of_multiple) uiout->field_fmt ("number", "%d.%d", b->number, loc_number); else - uiout->field_int ("number", b->number); + uiout->field_signed ("number", b->number); /* 2 */ annotate_field (1); @@ -6101,12 +6101,12 @@ print_one_breakpoint_location (struct breakpoint *b, /* FIXME: This seems to be redundant and lost here; see the "stop only in" line a little further down. */ uiout->text (" thread "); - uiout->field_int ("thread", b->thread); + uiout->field_signed ("thread", b->thread); } else if (b->task != 0) { uiout->text (" task "); - uiout->field_int ("task", b->task); + uiout->field_signed ("task", b->task); } } @@ -6154,7 +6154,7 @@ print_one_breakpoint_location (struct breakpoint *b, /* FIXME should make an annotation for this. */ uiout->text ("\tstop only in thread "); if (uiout->is_mi_like_p ()) - uiout->field_int ("thread", b->thread); + uiout->field_signed ("thread", b->thread); else { struct thread_info *thr = find_thread_global_id (b->thread); @@ -6176,7 +6176,7 @@ print_one_breakpoint_location (struct breakpoint *b, else uiout->text ("\tbreakpoint"); uiout->text (" already hit "); - uiout->field_int ("times", b->hit_count); + uiout->field_signed ("times", b->hit_count); if (b->hit_count == 1) uiout->text (" time\n"); else @@ -6186,7 +6186,7 @@ print_one_breakpoint_location (struct breakpoint *b, { /* Output the count also if it is zero, but only if this is mi. */ if (uiout->is_mi_like_p ()) - uiout->field_int ("times", b->hit_count); + uiout->field_signed ("times", b->hit_count); } } @@ -6194,7 +6194,7 @@ print_one_breakpoint_location (struct breakpoint *b, { annotate_field (8); uiout->text ("\tignore next "); - uiout->field_int ("ignore", b->ignore_count); + uiout->field_signed ("ignore", b->ignore_count); uiout->text (" hits\n"); } @@ -6211,7 +6211,7 @@ print_one_breakpoint_location (struct breakpoint *b, uiout->text ("additional "); else uiout->text ("next "); - uiout->field_int ("enable", b->enable_count); + uiout->field_signed ("enable", b->enable_count); uiout->text (" hits\n"); } @@ -6222,7 +6222,7 @@ print_one_breakpoint_location (struct breakpoint *b, if (tp->traceframe_usage) { uiout->text ("\ttrace buffer usage "); - uiout->field_int ("traceframe-usage", tp->traceframe_usage); + uiout->field_signed ("traceframe-usage", tp->traceframe_usage); uiout->text (" bytes\n"); } } @@ -6243,7 +6243,7 @@ print_one_breakpoint_location (struct breakpoint *b, { annotate_field (10); uiout->text ("\tpass count "); - uiout->field_int ("pass", t->pass_count); + uiout->field_signed ("pass", t->pass_count); uiout->text (" \n"); } @@ -7689,9 +7689,9 @@ print_it_catch_fork (bpstat bs) uiout->field_string ("reason", async_reason_lookup (EXEC_ASYNC_FORK)); uiout->field_string ("disp", bpdisp_text (b->disposition)); } - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (" (forked process "); - uiout->field_int ("newpid", c->forked_inferior_pid.pid ()); + uiout->field_signed ("newpid", c->forked_inferior_pid.pid ()); uiout->text ("), "); return PRINT_SRC_AND_LOC; } @@ -7718,7 +7718,7 @@ print_one_catch_fork (struct breakpoint *b, struct bp_location **last_loc) if (c->forked_inferior_pid != null_ptid) { uiout->text (", process "); - uiout->field_int ("what", c->forked_inferior_pid.pid ()); + uiout->field_signed ("what", c->forked_inferior_pid.pid ()); uiout->spaces (1); } @@ -7805,9 +7805,9 @@ print_it_catch_vfork (bpstat bs) uiout->field_string ("reason", async_reason_lookup (EXEC_ASYNC_VFORK)); uiout->field_string ("disp", bpdisp_text (b->disposition)); } - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (" (vforked process "); - uiout->field_int ("newpid", c->forked_inferior_pid.pid ()); + uiout->field_signed ("newpid", c->forked_inferior_pid.pid ()); uiout->text ("), "); return PRINT_SRC_AND_LOC; } @@ -7833,7 +7833,7 @@ print_one_catch_vfork (struct breakpoint *b, struct bp_location **last_loc) if (c->forked_inferior_pid != null_ptid) { uiout->text (", process "); - uiout->field_int ("what", c->forked_inferior_pid.pid ()); + uiout->field_signed ("what", c->forked_inferior_pid.pid ()); uiout->spaces (1); } @@ -7974,7 +7974,7 @@ print_it_catch_solib (bpstat bs) uiout->text ("Temporary catchpoint "); else uiout->text ("Catchpoint "); - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text ("\n"); if (uiout->is_mi_like_p ()) uiout->field_string ("disp", bpdisp_text (b->disposition)); @@ -8224,7 +8224,7 @@ print_it_catch_exec (bpstat bs) uiout->field_string ("reason", async_reason_lookup (EXEC_ASYNC_EXEC)); uiout->field_string ("disp", bpdisp_text (b->disposition)); } - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (" (exec'd "); uiout->field_string ("new-exec", c->exec_pathname); uiout->text ("), "); @@ -9621,7 +9621,7 @@ print_it_ranged_breakpoint (bpstat bs) async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); uiout->field_string ("disp", bpdisp_text (b->disposition)); } - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (", "); return PRINT_SRC_AND_LOC; @@ -10197,7 +10197,7 @@ print_mention_watchpoint (struct breakpoint *b) } ui_out_emit_tuple tuple_emitter (uiout, tuple_name); - uiout->field_int ("number", b->number); + uiout->field_signed ("number", b->number); uiout->text (": "); uiout->field_string ("exp", w->exp_string); } @@ -10390,7 +10390,7 @@ print_mention_masked_watchpoint (struct breakpoint *b) } ui_out_emit_tuple tuple_emitter (uiout, tuple_name); - uiout->field_int ("number", b->number); + uiout->field_signed ("number", b->number); uiout->text (": "); uiout->field_string ("exp", w->exp_string); } @@ -12400,7 +12400,7 @@ bkpt_print_it (bpstat bs) async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); uiout->field_string ("disp", bpdisp_text (b->disposition)); } - uiout->field_int ("bkptno", b->number); + uiout->field_signed ("bkptno", b->number); uiout->text (", "); return PRINT_SRC_AND_LOC; @@ -13333,7 +13333,7 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal) uiout->field_string ("fullname", fullname); } - uiout->field_int ("line", sal2.line); + uiout->field_signed ("line", sal2.line); uiout->text ("\n"); b->loc->line_number = sal2.line; diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 8d6b426203f..75a2259ab0b 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -93,15 +93,13 @@ cli_ui_out::do_end (ui_out_type type) /* output an int field */ void -cli_ui_out::do_field_int (int fldno, int width, ui_align alignment, - const char *fldname, int value) +cli_ui_out::do_field_signed (int fldno, int width, ui_align alignment, + const char *fldname, LONGEST value) { if (m_suppress_output) return; - std::string str = string_printf ("%d", value); - - do_field_string (fldno, width, alignment, fldname, str.c_str (), + do_field_string (fldno, width, alignment, fldname, plongest (value), ui_out_style_kind::DEFAULT); } diff --git a/gdb/cli-out.h b/gdb/cli-out.h index fd1d6274a9f..d28f468a3e7 100644 --- a/gdb/cli-out.h +++ b/gdb/cli-out.h @@ -45,8 +45,8 @@ protected: zero. */ virtual void do_begin (ui_out_type type, const char *id) override; virtual void do_end (ui_out_type type) override; - virtual void do_field_int (int fldno, int width, ui_align align, - const char *fldname, int value) override; + virtual void do_field_signed (int fldno, int width, ui_align align, + const char *fldname, LONGEST value) override; virtual void do_field_unsigned (int fldno, int width, ui_align align, const char *fldname, ULONGEST value) override; diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c index ca3b2e87252..103ac2a9773 100644 --- a/gdb/darwin-nat-info.c +++ b/gdb/darwin-nat-info.c @@ -664,14 +664,14 @@ darwin_debug_regions_recurse (task_t task) unparse_inheritance (r_info.inheritance)); uiout->field_string ("share-mode", unparse_share_mode (r_info.share_mode)); - uiout->field_int ("depth", r_depth); + uiout->field_signed ("depth", r_depth); uiout->field_string ("submap", r_info.is_submap ? _("sm ") : _("obj")); tag = unparse_user_tag (r_info.user_tag); if (tag) uiout->field_string ("tag", tag); else - uiout->field_int ("tag", r_info.user_tag); + uiout->field_signed ("tag", r_info.user_tag); } uiout->text ("\n"); diff --git a/gdb/disasm.c b/gdb/disasm.c index 5e1dd6e3a3d..e2b4fd63918 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -247,7 +247,7 @@ gdb_pretty_print_disassembler::pretty_print_insn (struct ui_out *uiout, uiout->field_string ("func-name", name.c_str (), ui_out_style_kind::FUNCTION); uiout->text ("+"); - uiout->field_int ("offset", offset); + uiout->field_signed ("offset", offset); uiout->text (">:\t"); } else diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index 132cb6f4705..0334523ef11 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -940,7 +940,7 @@ print_one_bfd (void **slot, void *data) struct ui_out *uiout = (struct ui_out *) data; ui_out_emit_tuple tuple_emitter (uiout, NULL); - uiout->field_int ("refcount", gdata->refc); + uiout->field_signed ("refcount", gdata->refc); uiout->field_string ("addr", host_address_to_string (abfd)); uiout->field_string ("filename", bfd_get_filename (abfd)); uiout->text ("\n"); diff --git a/gdb/inferior.c b/gdb/inferior.c index 1415670b261..2d58a11ba85 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -481,7 +481,7 @@ print_inferior (struct ui_out *uiout, const char *requested_inferiors) else uiout->field_skip ("current"); - uiout->field_int ("number", inf->num); + uiout->field_signed ("number", inf->num); uiout->field_string ("target-id", inferior_pid_to_str (inf->pid)); @@ -496,12 +496,12 @@ print_inferior (struct ui_out *uiout, const char *requested_inferiors) if (inf->vfork_parent) { uiout->text (_("\n\tis vfork child of inferior ")); - uiout->field_int ("vfork-parent", inf->vfork_parent->num); + uiout->field_signed ("vfork-parent", inf->vfork_parent->num); } if (inf->vfork_child) { uiout->text (_("\n\tis vfork parent of inferior ")); - uiout->field_int ("vfork-child", inf->vfork_child->num); + uiout->field_signed ("vfork-child", inf->vfork_child->num); } uiout->text ("\n"); diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index 714ab01b264..963c8c7bd2d 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -53,13 +53,13 @@ mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc) error (_("-file-list-exec-source-file: No symtab")); /* Print to the user the line, filename and fullname. */ - uiout->field_int ("line", st.line); + uiout->field_signed ("line", st.line); uiout->field_string ("file", symtab_to_filename_for_display (st.symtab)); uiout->field_string ("fullname", symtab_to_fullname (st.symtab)); - uiout->field_int ("macro-info", - COMPUNIT_MACRO_TABLE (SYMTAB_COMPUNIT (st.symtab)) != NULL); + uiout->field_signed ("macro-info", + COMPUNIT_MACRO_TABLE (SYMTAB_COMPUNIT (st.symtab)) != NULL); } /* A callback for map_partial_symbol_filenames. */ diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index c8a4ce73c97..e8f8d159d2d 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -204,7 +204,7 @@ mi_cmd_stack_info_depth (const char *command, char **argv, int argc) i++, fi = get_prev_frame (fi)) QUIT; - current_uiout->field_int ("depth", i); + current_uiout->field_signed ("depth", i); } /* Print a list of the locals for the current frame. With argument of @@ -391,7 +391,7 @@ mi_cmd_stack_list_args (const char *command, char **argv, int argc) { QUIT; ui_out_emit_tuple tuple_emitter (uiout, "frame"); - uiout->field_int ("level", i); + uiout->field_signed ("level", i); list_args_or_locals (user_frame_print_options, arguments, print_values, fi, skip_unavailable); } @@ -521,7 +521,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what, uiout->field_stream ("name", stb); if (what == all && SYMBOL_IS_ARGUMENT (arg->sym)) - uiout->field_int ("arg", 1); + uiout->field_signed ("arg", 1); if (values == PRINT_SIMPLE_VALUES) { diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 662ffa3f4d9..f5219e0f9b2 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -60,7 +60,7 @@ print_varobj (struct varobj *var, enum print_values print_values, uiout->field_string ("exp", exp.c_str ()); } - uiout->field_int ("numchild", varobj_get_num_children (var)); + uiout->field_signed ("numchild", varobj_get_num_children (var)); if (mi_print_value_p (var, print_values)) { @@ -75,17 +75,17 @@ print_varobj (struct varobj *var, enum print_values print_values, thread_id = varobj_get_thread_id (var); if (thread_id > 0) - uiout->field_int ("thread-id", thread_id); + uiout->field_signed ("thread-id", thread_id); if (varobj_get_frozen (var)) - uiout->field_int ("frozen", 1); + uiout->field_signed ("frozen", 1); gdb::unique_xmalloc_ptr display_hint = varobj_get_display_hint (var); if (display_hint) uiout->field_string ("displayhint", display_hint.get ()); if (varobj_is_dynamic_p (var)) - uiout->field_int ("dynamic", 1); + uiout->field_signed ("dynamic", 1); } /* VAROBJ operations */ @@ -138,7 +138,7 @@ mi_cmd_var_create (const char *command, char **argv, int argc) print_varobj (var, PRINT_ALL_VALUES, 0 /* don't print expression */); - uiout->field_int ("has_more", varobj_has_more (var, 0)); + uiout->field_signed ("has_more", varobj_has_more (var, 0)); } void @@ -183,7 +183,7 @@ mi_cmd_var_delete (const char *command, char **argv, int argc) numdel = varobj_delete (var, children_only_p); - uiout->field_int ("ndeleted", numdel); + uiout->field_signed ("ndeleted", numdel); } /* Parse a string argument into a format value. */ @@ -313,7 +313,7 @@ mi_cmd_var_info_num_children (const char *command, char **argv, int argc) /* Get varobj handle, if a valid var obj name was specified. */ var = varobj_get_handle (argv[0]); - uiout->field_int ("numchild", varobj_get_num_children (var)); + uiout->field_signed ("numchild", varobj_get_num_children (var)); } /* Return 1 if given the argument PRINT_VALUES we should display @@ -380,7 +380,7 @@ mi_cmd_var_list_children (const char *command, char **argv, int argc) const std::vector &children = varobj_list_children (var, &from, &to); - uiout->field_int ("numchild", to - from); + uiout->field_signed ("numchild", to - from); if (argc == 2 || argc == 4) print_values = mi_parse_print_values (argv[0]); else @@ -409,7 +409,7 @@ mi_cmd_var_list_children (const char *command, char **argv, int argc) } } - uiout->field_int ("has_more", varobj_has_more (var, to)); + uiout->field_signed ("has_more", varobj_has_more (var, to)); } void @@ -732,8 +732,8 @@ varobj_update_one (struct varobj *var, enum print_values print_values, } if (r.type_changed || r.children_changed) - uiout->field_int ("new_num_children", - varobj_get_num_children (r.varobj)); + uiout->field_signed ("new_num_children", + varobj_get_num_children (r.varobj)); gdb::unique_xmalloc_ptr display_hint = varobj_get_display_hint (r.varobj); @@ -741,10 +741,10 @@ varobj_update_one (struct varobj *var, enum print_values print_values, uiout->field_string ("displayhint", display_hint.get ()); if (varobj_is_dynamic_p (r.varobj)) - uiout->field_int ("dynamic", 1); + uiout->field_signed ("dynamic", 1); varobj_get_child_range (r.varobj, &from, &to); - uiout->field_int ("has_more", varobj_has_more (r.varobj, to)); + uiout->field_signed ("has_more", varobj_has_more (r.varobj, to)); if (!r.newobj.empty ()) { diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 03ab169fdf5..9033a61950d 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -633,19 +633,19 @@ mi_on_normal_stop_1 (struct bpstats *bs, int print_frame) if (console_print) print_stop_event (mi->cli_uiout); - mi_uiout->field_int ("thread-id", tp->global_num); + mi_uiout->field_signed ("thread-id", tp->global_num); if (non_stop) { ui_out_emit_list list_emitter (mi_uiout, "stopped-threads"); - mi_uiout->field_int (NULL, tp->global_num); + mi_uiout->field_signed (NULL, tp->global_num); } else mi_uiout->field_string ("stopped-threads", "all"); core = target_core_of_thread (tp->ptid); if (core != -1) - mi_uiout->field_int ("core", core); + mi_uiout->field_signed ("core", core); } fputs_unfiltered ("*stopped", mi->raw_stdout); @@ -1034,7 +1034,7 @@ mi_output_solib_attribs (ui_out *uiout, struct so_list *solib) uiout->field_string ("id", solib->so_original_name); uiout->field_string ("target-name", solib->so_original_name); uiout->field_string ("host-name", solib->so_name); - uiout->field_int ("symbols-loaded", solib->symbols_loaded); + uiout->field_signed ("symbols-loaded", solib->symbols_loaded); if (!gdbarch_has_global_solist (target_gdbarch ())) uiout->field_fmt ("thread-group", "i%d", current_inferior ()->num); diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 26ffeb0751c..5dc436bfd8c 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -592,13 +592,13 @@ mi_cmd_thread_list_ids (const char *command, char **argv, int argc) current_thread = tp->global_num; num++; - current_uiout->field_int ("thread-id", tp->global_num); + current_uiout->field_signed ("thread-id", tp->global_num); } } if (current_thread != -1) - current_uiout->field_int ("current-thread-id", current_thread); - current_uiout->field_int ("number-of-threads", num); + current_uiout->field_signed ("current-thread-id", current_thread); + current_uiout->field_signed ("number-of-threads", num); } void @@ -658,7 +658,7 @@ print_one_inferior (struct inferior *inferior, void *xdata) uiout->field_string ("exit-code", int_string (inferior->exit_code, 8, 0, 0, 1)); if (inferior->pid != 0) - uiout->field_int ("pid", inferior->pid); + uiout->field_signed ("pid", inferior->pid); if (inferior->pspace->pspace_exec_filename != NULL) { @@ -677,7 +677,7 @@ print_one_inferior (struct inferior *inferior, void *xdata) ui_out_emit_list list_emitter (uiout, "cores"); for (int b : data.cores) - uiout->field_int (NULL, b); + uiout->field_signed (NULL, b); } if (top_data->recurse) @@ -964,7 +964,7 @@ mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc) if (register_changed_p (regnum, prev_regs.get (), this_regs.get ())) - uiout->field_int (NULL, regnum); + uiout->field_signed (NULL, regnum); } } @@ -980,7 +980,7 @@ mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc) { if (register_changed_p (regnum, prev_regs.get (), this_regs.get ())) - uiout->field_int (NULL, regnum); + uiout->field_signed (NULL, regnum); } else error (_("bad register number")); @@ -1124,7 +1124,7 @@ output_register (struct frame_info *frame, int regnum, int format, return; ui_out_emit_tuple tuple_emitter (uiout, NULL); - uiout->field_int ("number", regnum); + uiout->field_signed ("number", regnum); if (format == 'N') format = 0; @@ -1353,8 +1353,8 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc) /* Output the header information. */ uiout->field_core_addr ("addr", gdbarch, addr); - uiout->field_int ("nr-bytes", nr_bytes); - uiout->field_int ("total-bytes", total_bytes); + uiout->field_signed ("nr-bytes", nr_bytes); + uiout->field_signed ("total-bytes", total_bytes); uiout->field_core_addr ("next-row", gdbarch, addr + word_size * nr_cols); uiout->field_core_addr ("prev-row", gdbarch, addr - word_size * nr_cols); uiout->field_core_addr ("next-page", gdbarch, addr + total_bytes); @@ -2191,8 +2191,8 @@ mi_load_progress (const char *section_name, { ui_out_emit_tuple tuple_emitter (uiout.get (), NULL); uiout->field_string ("section", section_name); - uiout->field_int ("section-size", total_section); - uiout->field_int ("total-size", grand_total); + uiout->field_signed ("section-size", total_section); + uiout->field_signed ("total-size", grand_total); } mi_out_put (uiout.get (), mi->raw_stdout); fputs_unfiltered ("\n", mi->raw_stdout); @@ -2209,10 +2209,10 @@ mi_load_progress (const char *section_name, { ui_out_emit_tuple tuple_emitter (uiout.get (), NULL); uiout->field_string ("section", section_name); - uiout->field_int ("section-sent", sent_so_far); - uiout->field_int ("section-size", total_section); - uiout->field_int ("total-sent", total_sent); - uiout->field_int ("total-size", grand_total); + uiout->field_signed ("section-sent", sent_so_far); + uiout->field_signed ("section-size", total_section); + uiout->field_signed ("total-sent", total_sent); + uiout->field_signed ("total-size", grand_total); } mi_out_put (uiout.get (), mi->raw_stdout); fputs_unfiltered ("\n", mi->raw_stdout); @@ -2656,7 +2656,7 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc) tsv->value_known = target_get_trace_state_variable_value (tsv->number, &tsv->value); - uiout->field_int ("current", tsv->value); + uiout->field_signed ("current", tsv->value); } else { @@ -2681,7 +2681,7 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc) ui_out_emit_tuple tuple_emitter (uiout, NULL); uiout->field_core_addr ("address", gdbarch, r.start); - uiout->field_int ("length", r.length); + uiout->field_signed ("length", r.length); gdb::byte_vector data (r.length); diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index 75e3f0313d8..a6687178259 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -35,8 +35,8 @@ mi_ui_out::do_table_begin (int nr_cols, int nr_rows, const char *tblid) { open (tblid, ui_out_type_tuple); - do_field_int (-1, -1, ui_left, "nr_rows", nr_rows); - do_field_int (-1, -1, ui_left, "nr_cols", nr_cols); + do_field_signed (-1, -1, ui_left, "nr_rows", nr_rows); + do_field_signed (-1, -1, ui_left, "nr_cols", nr_cols); open ("hdr", ui_out_type_list); } @@ -67,8 +67,8 @@ mi_ui_out::do_table_header (int width, ui_align alignment, const std::string &col_hdr) { open (NULL, ui_out_type_tuple); - do_field_int (0, 0, ui_center, "width", width); - do_field_int (0, 0, ui_center, "alignment", alignment); + do_field_signed (0, 0, ui_center, "width", width); + do_field_signed (0, 0, ui_center, "alignment", alignment); do_field_string (0, 0, ui_center, "col_name", col_name.c_str (), ui_out_style_kind::DEFAULT); do_field_string (0, width, alignment, "colhdr", col_hdr.c_str (), @@ -95,8 +95,8 @@ mi_ui_out::do_end (ui_out_type type) /* Output an int field. */ void -mi_ui_out::do_field_int (int fldno, int width, ui_align alignment, - const char *fldname, int value) +mi_ui_out::do_field_signed (int fldno, int width, ui_align alignment, + const char *fldname, LONGEST value) { do_field_string (fldno, width, alignment, fldname, plongest (value), ui_out_style_kind::DEFAULT); diff --git a/gdb/mi/mi-out.h b/gdb/mi/mi-out.h index 1328684ed2b..01d15e38ba0 100644 --- a/gdb/mi/mi-out.h +++ b/gdb/mi/mi-out.h @@ -52,8 +52,8 @@ protected: virtual void do_begin (ui_out_type type, const char *id) override; virtual void do_end (ui_out_type type) override; - virtual void do_field_int (int fldno, int width, ui_align align, - const char *fldname, int value) override; + virtual void do_field_signed (int fldno, int width, ui_align align, + const char *fldname, LONGEST value) override; virtual void do_field_unsigned (int fldno, int width, ui_align align, const char *fldname, ULONGEST value) override; diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c index 78a5590a15d..63142e8e7e9 100644 --- a/gdb/mi/mi-symbol-cmds.c +++ b/gdb/mi/mi-symbol-cmds.c @@ -56,6 +56,6 @@ mi_cmd_symbol_list_lines (const char *command, char **argv, int argc) { ui_out_emit_tuple tuple_emitter (uiout, NULL); uiout->field_core_addr ("pc", gdbarch, SYMTAB_LINETABLE (s)->item[i].pc); - uiout->field_int ("line", SYMTAB_LINETABLE (s)->item[i].line); + uiout->field_signed ("line", SYMTAB_LINETABLE (s)->item[i].line); } } diff --git a/gdb/progspace.c b/gdb/progspace.c index 1c749621ad6..366de546bb5 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -272,7 +272,7 @@ print_program_space (struct ui_out *uiout, int requested) else uiout->field_skip ("current"); - uiout->field_int ("id", pspace->num); + uiout->field_signed ("id", pspace->num); if (pspace->pspace_exec_filename) uiout->field_string ("exec", pspace->pspace_exec_filename); diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index a351ac5aec8..840faf963c7 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -370,7 +370,7 @@ py_print_single_arg (struct ui_out *out, out->text ("="); if (print_args_field) - out->field_int ("arg", 1); + out->field_signed ("arg", 1); /* For MI print the type, but only for simple values. This seems weird, but this is how MI choose to format the various output @@ -839,8 +839,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags, annotate_frame_begin (print_level ? level : 0, gdbarch, address); out->text ("#"); - out->field_fmt_int (2, ui_left, "level", - level); + out->field_fmt_signed (2, ui_left, "level", level); } } @@ -956,7 +955,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags, out->text (":"); annotate_frame_source_line (); - out->field_int ("line", line); + out->field_signed ("line", line); } } if (out->is_mi_like_p ()) diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 77f2e7c27a9..fa89aa60a3c 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -617,7 +617,7 @@ btrace_ui_out_decode_error (struct ui_out *uiout, int errcode, if (!(format == BTRACE_FORMAT_PT && errcode > 0)) { uiout->text (_("decode error (")); - uiout->field_int ("errcode", errcode); + uiout->field_signed ("errcode", errcode); uiout->text (_("): ")); } uiout->text (errstr); @@ -1091,13 +1091,13 @@ btrace_call_history_src_line (struct ui_out *uiout, return; uiout->text (":"); - uiout->field_int ("min line", begin); + uiout->field_signed ("min line", begin); if (end == begin) return; uiout->text (","); - uiout->field_int ("max line", end); + uiout->field_signed ("max line", end); } /* Get the name of a branch trace function. */ diff --git a/gdb/skip.c b/gdb/skip.c index 039d50cb117..499b80d5777 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -399,7 +399,7 @@ info_skip_command (const char *arg, int from_tty) continue; ui_out_emit_tuple tuple_emitter (current_uiout, "blklst-entry"); - current_uiout->field_int ("number", e.number ()); /* 1 */ + current_uiout->field_signed ("number", e.number ()); /* 1 */ if (e.enabled ()) current_uiout->field_string ("enabled", "y"); /* 2 */ diff --git a/gdb/source.c b/gdb/source.c index 8ebc4361e17..a83e55e5699 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1269,7 +1269,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, } else { - uiout->field_int ("line", line); + uiout->field_signed ("line", line); uiout->text ("\tin "); /* CLI expects only the "file" field. TUI expects only the diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 69ffb69fcb9..ddaee54b306 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -2168,12 +2168,12 @@ info_spu_signal_command (const char *args, int from_tty) if (current_uiout->is_mi_like_p ()) { - current_uiout->field_int ("signal1_pending", signal1_pending); + current_uiout->field_signed ("signal1_pending", signal1_pending); current_uiout->field_fmt ("signal1", "0x%s", phex_nz (signal1, 4)); - current_uiout->field_int ("signal1_type", signal1_type); - current_uiout->field_int ("signal2_pending", signal2_pending); + current_uiout->field_signed ("signal1_type", signal1_type); + current_uiout->field_signed ("signal2_pending", signal2_pending); current_uiout->field_fmt ("signal2", "0x%s", phex_nz (signal2, 4)); - current_uiout->field_int ("signal2_type", signal2_type); + current_uiout->field_signed ("signal2_type", signal2_type); } else { @@ -2415,11 +2415,11 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order) if (spu_mfc_opcode[mfc_cmd_opcode]) current_uiout->field_string ("opcode", spu_mfc_opcode[mfc_cmd_opcode]); else - current_uiout->field_int ("opcode", mfc_cmd_opcode); + current_uiout->field_signed ("opcode", mfc_cmd_opcode); - current_uiout->field_int ("tag", mfc_cmd_tag); - current_uiout->field_int ("tid", tclass_id); - current_uiout->field_int ("rid", rclass_id); + current_uiout->field_signed ("tag", mfc_cmd_tag); + current_uiout->field_signed ("tid", tclass_id); + current_uiout->field_signed ("rid", rclass_id); if (ea_valid_p) current_uiout->field_fmt ("ea", "0x%s", phex (mfc_ea, 8)); diff --git a/gdb/stack.c b/gdb/stack.c index 9b1d1a68568..959ae652ec2 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -895,8 +895,8 @@ print_frame_info (const frame_print_options &fp_opts, if (print_level) { uiout->text ("#"); - uiout->field_fmt_int (2, ui_left, "level", - frame_relative_level (frame)); + uiout->field_fmt_signed (2, ui_left, "level", + frame_relative_level (frame)); } if (uiout->is_mi_like_p ()) { @@ -1243,8 +1243,8 @@ print_frame (const frame_print_options &fp_opts, if (print_level) { uiout->text ("#"); - uiout->field_fmt_int (2, ui_left, "level", - frame_relative_level (frame)); + uiout->field_fmt_signed (2, ui_left, "level", + frame_relative_level (frame)); } get_user_print_options (&opts); if (opts.addressprint) @@ -1318,7 +1318,7 @@ print_frame (const frame_print_options &fp_opts, annotate_frame_source_file_end (); uiout->text (":"); annotate_frame_source_line (); - uiout->field_int ("line", sal.line); + uiout->field_signed ("line", sal.line); annotate_frame_source_end (); } diff --git a/gdb/thread.c b/gdb/thread.c index 2d25cee7cee..485c996e146 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1114,7 +1114,7 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads, } if (show_global_ids || uiout->is_mi_like_p ()) - uiout->field_int ("id", tp->global_num); + uiout->field_signed ("id", tp->global_num); /* For the CLI, we stuff everything into the target-id field. This is a gross hack to make the output come out looking @@ -1167,7 +1167,7 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads, core = target_core_of_thread (tp->ptid); if (uiout->is_mi_like_p () && core != -1) - uiout->field_int ("core", core); + uiout->field_signed ("core", core); } /* This end scope restores the current thread and the frame @@ -1178,7 +1178,7 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads, if (pid == -1 && requested_threads == NULL) { if (uiout->is_mi_like_p () && inferior_ptid != null_ptid) - uiout->field_int ("current-thread-id", current_thread->global_num); + uiout->field_signed ("current-thread-id", current_thread->global_num); if (inferior_ptid != null_ptid && current_exited) uiout->message ("\n\ @@ -1990,8 +1990,8 @@ print_selected_thread_frame (struct ui_out *uiout, { if (uiout->is_mi_like_p ()) { - uiout->field_int ("new-thread-id", - inferior_thread ()->global_num); + uiout->field_signed ("new-thread-id", + inferior_thread ()->global_num); } else { diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 5674400776a..075bd4c977b 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2000,8 +2000,8 @@ trace_status_mi (int on_stop) { uiout->field_string ("stop-reason", stop_reason); if (stopping_tracepoint != -1) - uiout->field_int ("stopping-tracepoint", - stopping_tracepoint); + uiout->field_signed ("stopping-tracepoint", + stopping_tracepoint); if (ts->stop_reason == tracepoint_error) uiout->field_string ("error-description", ts->stop_desc); @@ -2010,16 +2010,16 @@ trace_status_mi (int on_stop) } if (ts->traceframe_count != -1) - uiout->field_int ("frames", ts->traceframe_count); + uiout->field_signed ("frames", ts->traceframe_count); if (ts->traceframes_created != -1) - uiout->field_int ("frames-created", ts->traceframes_created); + uiout->field_signed ("frames-created", ts->traceframes_created); if (ts->buffer_size != -1) - uiout->field_int ("buffer-size", ts->buffer_size); + uiout->field_signed ("buffer-size", ts->buffer_size); if (ts->buffer_free != -1) - uiout->field_int ("buffer-free", ts->buffer_free); + uiout->field_signed ("buffer-free", ts->buffer_free); - uiout->field_int ("disconnected", ts->disconnected_tracing); - uiout->field_int ("circular", ts->circular_buffer); + uiout->field_signed ("disconnected", ts->disconnected_tracing); + uiout->field_signed ("circular", ts->circular_buffer); uiout->field_string ("user-name", ts->user_name); uiout->field_string ("notes", ts->notes); @@ -2183,8 +2183,8 @@ tfind_1 (enum trace_find_type type, int num, if (uiout->is_mi_like_p ()) { uiout->field_string ("found", "1"); - uiout->field_int ("tracepoint", tracepoint_number); - uiout->field_int ("traceframe", traceframe_number); + uiout->field_signed ("tracepoint", tracepoint_number); + uiout->field_signed ("traceframe", traceframe_number); } else { @@ -3665,7 +3665,7 @@ print_one_static_tracepoint_marker (int count, /* A counter field to help readability. This is not a stable identifier! */ - uiout->field_int ("count", count); + uiout->field_signed ("count", count); uiout->field_string ("marker-id", marker.str_id.c_str ()); @@ -3713,7 +3713,7 @@ print_one_static_tracepoint_marker (int count, else uiout->field_skip ("fullname"); - uiout->field_int ("line", sal.line); + uiout->field_signed ("line", sal.line); } else { @@ -3741,12 +3741,12 @@ print_one_static_tracepoint_marker (int count, if (ix > 0) uiout->text (", "); uiout->text ("#"); - uiout->field_int ("tracepoint-id", tracepoints[ix]->number); + uiout->field_signed ("tracepoint-id", tracepoints[ix]->number); } } if (uiout->is_mi_like_p ()) - uiout->field_int ("number-of-tracepoints", tracepoints.size ()); + uiout->field_signed ("number-of-tracepoints", tracepoints.size ()); else uiout->text ("\n"); } diff --git a/gdb/tui/tui-out.c b/gdb/tui/tui-out.c index 5fabff2cf1c..50865ba0465 100644 --- a/gdb/tui/tui-out.c +++ b/gdb/tui/tui-out.c @@ -28,8 +28,8 @@ /* Output an int field. */ void -tui_ui_out::do_field_int (int fldno, int width, ui_align alignment, - const char *fldname, int value) +tui_ui_out::do_field_signed (int fldno, int width, ui_align alignment, + const char *fldname, LONGEST value) { if (suppress_output ()) return; @@ -43,7 +43,7 @@ tui_ui_out::do_field_int (int fldno, int width, ui_align alignment, } m_start_of_line++; - cli_ui_out::do_field_int (fldno, width, alignment, fldname, value); + cli_ui_out::do_field_signed (fldno, width, alignment, fldname, value); } /* Other cli_field_* end up here so alignment and field separators are diff --git a/gdb/tui/tui-out.h b/gdb/tui/tui-out.h index edf0b912bef..083094ba75e 100644 --- a/gdb/tui/tui-out.h +++ b/gdb/tui/tui-out.h @@ -32,8 +32,8 @@ public: protected: - void do_field_int (int fldno, int width, ui_align align, const char *fldname, - int value) override; + void do_field_signed (int fldno, int width, ui_align align, const char *fldname, + LONGEST value) override; void do_field_string (int fldno, int width, ui_align align, const char *fldname, const char *string, ui_out_style_kind style) override; void do_field_fmt (int fldno, int width, ui_align align, const char *fldname, diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 65312aa4323..91662fac4a2 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -438,7 +438,7 @@ ui_out::end (ui_out_type type) } void -ui_out::field_int (const char *fldname, int value) +ui_out::field_signed (const char *fldname, LONGEST value) { int fldno; int width; @@ -446,12 +446,12 @@ ui_out::field_int (const char *fldname, int value) verify_field (&fldno, &width, &align); - do_field_int (fldno, width, align, fldname, value); + do_field_signed (fldno, width, align, fldname, value); } void -ui_out::field_fmt_int (int input_width, ui_align input_align, - const char *fldname, int value) +ui_out::field_fmt_signed (int input_width, ui_align input_align, + const char *fldname, LONGEST value) { int fldno; int width; @@ -459,7 +459,7 @@ ui_out::field_fmt_int (int input_width, ui_align input_align, verify_field (&fldno, &width, &align); - do_field_int (fldno, input_width, input_align, fldname, value); + do_field_signed (fldno, input_width, input_align, fldname, value); } /* See ui-out.h. */ diff --git a/gdb/ui-out.h b/gdb/ui-out.h index afc1c41651d..3398e432423 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -107,10 +107,10 @@ class ui_out void begin (ui_out_type type, const char *id); void end (ui_out_type type); - void field_int (const char *fldname, int value); - void field_fmt_int (int width, ui_align align, const char *fldname, - int value); - /* Like field_int, but print an unsigned value. */ + void field_signed (const char *fldname, LONGEST value); + void field_fmt_signed (int width, ui_align align, const char *fldname, + LONGEST value); + /* Like field_signed, but print an unsigned value. */ void field_unsigned (const char *fldname, ULONGEST value); void field_core_addr (const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address); @@ -157,8 +157,8 @@ class ui_out virtual void do_begin (ui_out_type type, const char *id) = 0; virtual void do_end (ui_out_type type) = 0; - virtual void do_field_int (int fldno, int width, ui_align align, - const char *fldname, int value) = 0; + virtual void do_field_signed (int fldno, int width, ui_align align, + const char *fldname, LONGEST value) = 0; virtual void do_field_unsigned (int fldno, int width, ui_align align, const char *fldname, ULONGEST value) = 0; virtual void do_field_skip (int fldno, int width, ui_align align, -- 2.30.2