From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 5D529394B02F; Sat, 14 Mar 2020 00:07:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D529394B02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1584144442; bh=8DY8we8uWj37cg9/MNPa+CekE2OmhqTa4JnCYFJ1S9M=; h=From:To:Subject:Date:From; b=UIikJp13MTOmc9odThUGoFZG/VXkVIrRUjaMk3ymfIOeAnjnucsQBYeLAmJh2z8Zr pjGcQpKh5RKS7OQUT5bxlbMG808T4KsGr5wpzYP7nohuexjQ7Sj3Qin7D2Jx1v0WcY ixeao0U4HfrV8HK8zulfgAqzF9aK291V8zpVsy1o= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Introduce generic_value_print_int X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 6dde752183769c712eb22f49a5b74bfadad4a6be X-Git-Newrev: fdddfccba1cc4f70089873441b7e6c38de09ae37 Message-Id: <20200314000722.5D529394B02F@sourceware.org> Date: Sat, 14 Mar 2020 00:07:22 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2020 00:07:22 -0000 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fdddfccba1cc4f70089873441b7e6c38de09ae37 commit fdddfccba1cc4f70089873441b7e6c38de09ae37 Author: Tom Tromey Date: Fri Mar 13 17:39:52 2020 -0600 Introduce generic_value_print_int This adds generic_value_print_int, a value-based analogue of generic_val_print_int. gdb/ChangeLog 2020-03-13 Tom Tromey * valprint.c (generic_value_print_int): New function. (generic_value_print): Use it. Diff: --- gdb/ChangeLog | 5 +++++ gdb/valprint.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d15ca6c24a..2ca8e66a122 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-03-13 Tom Tromey + + * valprint.c (generic_value_print_int): New function. + (generic_value_print): Use it. + 2020-03-13 Tom Tromey * valprint.c (generic_value_print_bool): New function. diff --git a/gdb/valprint.c b/gdb/valprint.c index 56a2e99c860..c9ad2749272 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -834,6 +834,19 @@ generic_val_print_int (struct type *type, original_value, &opts, 0, stream); } +/* generic_value_print helper for TYPE_CODE_INT. */ + +static void +generic_value_print_int (struct value *val, struct ui_file *stream, + const struct value_print_options *options) +{ + struct value_print_options opts = *options; + + opts.format = (options->format ? options->format + : options->output_format); + value_print_scalar_formatted (val, &opts, 0, stream); +} + /* generic_val_print helper for TYPE_CODE_CHAR. */ static void @@ -1134,8 +1147,7 @@ generic_value_print (struct value *val, struct ui_file *stream, int recurse, /* FALLTHROUGH */ case TYPE_CODE_INT: - generic_val_print_int (type, 0, stream, - val, options); + generic_value_print_int (val, stream, options); break; case TYPE_CODE_CHAR: