aboutsummaryrefslogtreecommitdiff
path: root/gdb/record-btrace.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-07-01 12:14:48 -0600
committerTom Tromey <tromey@adacore.com>2019-07-15 09:31:18 -0600
commit1f77b012e61ec11c92a35223fdfed598c6d2f4e9 (patch)
tree46a7d4bb2e7366a33728a40cfde72f0dfaf5c4fb /gdb/record-btrace.c
parent33eca68072e73d984fc139dde45b8140b94757cb (diff)
downloadfsf-binutils-gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.zip
fsf-binutils-gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.tar.gz
fsf-binutils-gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.tar.bz2
Introduce field_unsigned
This adds field_unsigned and changes various places using field_fmt with "%u" to use this instead. This also replaces an existing equivalent helper function in record-btrace.c. 2019-07-15 Tom Tromey <tromey@adacore.com> * mi/mi-out.h (class mi_ui_out) <do_field_unsigned>: Declare. * mi/mi-out.c (mi_ui_out::do_field_unsigned): New method. * cli-out.h (class cli_ui_out) <do_field_unsigned>: Declare. * cli-out.c (cli_ui_out::do_field_int): New method. * ui-out.c (ui_out::field_unsigned): New method. * symfile.c (generic_load): Use field_unsigned. (print_transfer_performance): Likewise. * record-btrace.c (ui_out_field_uint): Remove. (btrace_call_history_insn_range, btrace_call_history): Use field_unsigned. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Use field_unsigned. * ui-out.h (class ui_out) <field_unsigned>: New method. <do_field_unsigned>: Likewise.
Diffstat (limited to 'gdb/record-btrace.c')
-rw-r--r--gdb/record-btrace.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 73e7e32..77f2e7c 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -624,14 +624,6 @@ btrace_ui_out_decode_error (struct ui_out *uiout, int errcode,
uiout->text (_("]\n"));
}
-/* Print an unsigned int. */
-
-static void
-ui_out_field_uint (struct ui_out *uiout, const char *fld, unsigned int val)
-{
- uiout->field_fmt (fld, "%u", val);
-}
-
/* A range of source lines. */
struct btrace_line_range
@@ -1033,9 +1025,9 @@ btrace_call_history_insn_range (struct ui_out *uiout,
begin = bfun->insn_offset;
end = begin + size - 1;
- ui_out_field_uint (uiout, "insn begin", begin);
+ uiout->field_unsigned ("insn begin", begin);
uiout->text (",");
- ui_out_field_uint (uiout, "insn end", end);
+ uiout->field_unsigned ("insn end", end);
}
/* Compute the lowest and highest source line for the instructions in BFUN
@@ -1156,7 +1148,7 @@ btrace_call_history (struct ui_out *uiout,
msym = bfun->msym;
/* Print the function index. */
- ui_out_field_uint (uiout, "index", bfun->number);
+ uiout->field_unsigned ("index", bfun->number);
uiout->text ("\t");
/* Indicate gaps in the trace. */