aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
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/mi
parentUse field_string in more places (diff)
downloadbinutils-gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.tar.gz
binutils-gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.tar.bz2
binutils-gdb-1f77b012e61ec11c92a35223fdfed598c6d2f4e9.zip
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/mi')
-rw-r--r--gdb/mi/mi-out.c10
-rw-r--r--gdb/mi/mi-out.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index d8bee0f3927..dd99a2b7fb1 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -105,6 +105,16 @@ mi_ui_out::do_field_int (int fldno, int width, ui_align alignment,
ui_out_style_kind::DEFAULT);
}
+/* Output an unsigned field. */
+
+void
+mi_ui_out::do_field_unsigned (int fldno, int width, ui_align alignment,
+ const char *fldname, ULONGEST value)
+{
+ do_field_string (fldno, width, alignment, fldname, pulongest (value),
+ ui_out_style_kind::DEFAULT);
+}
+
/* Used to omit a field. */
void
diff --git a/gdb/mi/mi-out.h b/gdb/mi/mi-out.h
index 82f77592da8..1328684ed2b 100644
--- a/gdb/mi/mi-out.h
+++ b/gdb/mi/mi-out.h
@@ -54,6 +54,9 @@ protected:
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_unsigned (int fldno, int width, ui_align align,
+ const char *fldname, ULONGEST value)
+ override;
virtual void do_field_skip (int fldno, int width, ui_align align,
const char *fldname) override;
virtual void do_field_string (int fldno, int width, ui_align align,