aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.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/symfile.c
parent33eca68072e73d984fc139dde45b8140b94757cb (diff)
downloadgdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.zip
gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.tar.gz
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/symfile.c')
-rw-r--r--gdb/symfile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index caa0e79..d2b88fc 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2097,7 +2097,7 @@ generic_load (const char *args, int from_tty)
uiout->text ("Start address ");
uiout->field_core_addr ("address", target_gdbarch (), entry);
uiout->text (", load size ");
- uiout->field_fmt ("load-size", "%lu", total_progress.data_count);
+ uiout->field_unsigned ("load-size", total_progress.data_count);
uiout->text ("\n");
regcache_write_pc (get_current_regcache (), entry);
@@ -2140,29 +2140,29 @@ print_transfer_performance (struct ui_file *stream,
if (uiout->is_mi_like_p ())
{
- uiout->field_fmt ("transfer-rate", "%lu", rate * 8);
+ uiout->field_unsigned ("transfer-rate", rate * 8);
uiout->text (" bits/sec");
}
else if (rate < 1024)
{
- uiout->field_fmt ("transfer-rate", "%lu", rate);
+ uiout->field_unsigned ("transfer-rate", rate);
uiout->text (" bytes/sec");
}
else
{
- uiout->field_fmt ("transfer-rate", "%lu", rate / 1024);
+ uiout->field_unsigned ("transfer-rate", rate / 1024);
uiout->text (" KB/sec");
}
}
else
{
- uiout->field_fmt ("transferred-bits", "%lu", (data_count * 8));
+ uiout->field_unsigned ("transferred-bits", (data_count * 8));
uiout->text (" bits in <1 sec");
}
if (write_count > 0)
{
uiout->text (", ");
- uiout->field_fmt ("write-rate", "%lu", data_count / write_count);
+ uiout->field_unsigned ("write-rate", data_count / write_count);
uiout->text (" bytes/write");
}
uiout->text (".\n");