From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alt-proxy28.mail.unifiedlayer.com (alt-proxy28.mail.unifiedlayer.com [74.220.216.123]) by sourceware.org (Postfix) with ESMTPS id DFD5B3858420 for ; Sat, 22 Jan 2022 01:38:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFD5B3858420 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw12.mail.unifiedlayer.com (unknown [10.0.90.127]) by progateway1.mail.pro1.eigbox.com (Postfix) with ESMTP id 542981003FA20 for ; Sat, 22 Jan 2022 01:38:11 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id B5M2nH4YkXOyfB5M3nEVQN; Sat, 22 Jan 2022 01:38:11 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=Ot6Kdwzt c=1 sm=1 tr=0 ts=61eb6003 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=DghFqjY3_ZEA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=sPD-_4BUY3Wdsa4orgoA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3j/SWyU2nDDdiIz/4BfF/82+56trIqrSSZtIRpK9NK0=; b=EFKIKEtdLekA+Xzd/7A0CQxYeo RPEecRzImk9YhF9jK16JiBjPrRjkuOHa18FjybfJkjSvHh88+qB12iDlS/MPbh7GJnGJrtxlD+/Jl 7BpltgDrW3kYWF+ba3Cx9g5Vi; Received: from 75-166-128-165.hlrn.qwest.net ([75.166.128.165]:40604 helo=prentzel.Home) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nB5M2-001DkZ-It; Fri, 21 Jan 2022 18:38:10 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 13/19] Rename print_spaces_filtered Date: Fri, 21 Jan 2022 18:37:55 -0700 Message-Id: <20220122013801.666659-14-tom@tromey.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220122013801.666659-1-tom@tromey.com> References: <20220122013801.666659-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.128.165 X-Source-L: No X-Exim-ID: 1nB5M2-001DkZ-It X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-128-165.hlrn.qwest.net (prentzel.Home) [75.166.128.165]:40604 X-Source-Auth: tom+tromey.com X-Email-Count: 14 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3030.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2022 01:38:15 -0000 print_spaces_filtered is now misnamed, because whether filtering happens is up to the stream. So, rename it. --- gdb/ada-valprint.c | 10 +++++----- gdb/c-typeprint.c | 14 +++++++------- gdb/c-valprint.c | 2 +- gdb/cli-out.c | 2 +- gdb/cp-valprint.c | 8 ++++---- gdb/guile/scm-pretty-print.c | 6 +++--- gdb/m2-typeprint.c | 2 +- gdb/p-typeprint.c | 4 ++-- gdb/p-valprint.c | 10 +++++----- gdb/python/py-prettyprint.c | 6 +++--- gdb/riscv-tdep.c | 2 +- gdb/rust-lang.c | 12 ++++++------ gdb/symmisc.c | 2 +- gdb/typeprint.c | 4 ++-- gdb/utils.c | 2 +- gdb/utils.h | 2 +- gdb/valprint.c | 6 +++--- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 3dac4dc85b7..6aac5c36f1e 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -166,7 +166,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, if (options->prettyformat_arrays) { gdb_printf (stream, ",\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else { @@ -176,7 +176,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, else if (options->prettyformat_arrays) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } stream->wrap_here (2 + 2 * recurse); maybe_print_array_index (index_type, i + low, stream, options); @@ -229,7 +229,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, if (options->prettyformat_arrays) { gdb_printf (stream, ",\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else { @@ -610,7 +610,7 @@ print_field_values (struct value *value, struct value *outer_value, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else { @@ -876,7 +876,7 @@ ada_val_print_struct_union (struct value *value, && options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } gdb_printf (stream, ")"); diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 3612244c3d5..6d369886e37 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -906,7 +906,7 @@ c_type_print_template_args (const struct type_print_options *flags, gdb_puts (_("] "), stream); } -/* Use 'print_spaces_filtered', but take into consideration the +/* Use 'print_spaces', but take into consideration the type_print_options FLAGS in order to determine how many whitespaces will be printed. */ @@ -915,9 +915,9 @@ print_spaces_filtered_with_print_options (int level, struct ui_file *stream, const struct type_print_options *flags) { if (!flags->print_offsets) - print_spaces_filtered (level, stream); + print_spaces (level, stream); else - print_spaces_filtered (level + print_offset_data::indentation, stream); + print_spaces (level + print_offset_data::indentation, stream); } /* Output an access specifier to STREAM, if needed. LAST_ACCESS is the @@ -1175,7 +1175,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream, if (flags->print_offsets) podata->update (type, i, stream); - print_spaces_filtered (level + 4, stream); + print_spaces (level + 4, stream); if (is_static) gdb_printf (stream, "static "); @@ -1426,9 +1426,9 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream, if (show > 0) podata->finish (type, level, stream); - print_spaces_filtered (print_offset_data::indentation, stream); + print_spaces (print_offset_data::indentation, stream); if (level == 0) - print_spaces_filtered (2, stream); + print_spaces (2, stream); } gdb_printf (stream, "%*s}", level, ""); @@ -1639,7 +1639,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream, for (i = 0; i < len; i++) { QUIT; - print_spaces_filtered (level + 4, stream); + print_spaces (level + 4, stream); /* We pass "show" here and not "show - 1" to get enum types printed. There's no other way to see them. */ c_print_type_1 (type->field (i).type (), diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 2ab0772cbd3..4063445d404 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -222,7 +222,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } } } diff --git a/gdb/cli-out.c b/gdb/cli-out.c index f396aef12e3..39279d96397 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -211,7 +211,7 @@ cli_ui_out::do_spaces (int numspaces) if (test_flags (unfiltered_output)) gdb_printf (m_streams.back (), "%*s", numspaces, ""); else - print_spaces_filtered (numspaces, m_streams.back ()); + print_spaces (numspaces, m_streams.back ()); } void diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 92b5f440e76..fc5600c100c 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -207,7 +207,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); gdb_puts ("members of ", stream); gdb_puts (type->name (), stream); gdb_puts (":", stream); @@ -218,7 +218,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else { @@ -374,7 +374,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } } /* if there are data fields */ @@ -479,7 +479,7 @@ cp_print_value (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } gdb_puts ("<", stream); /* Not sure what the best notation is in the case where there is diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c index a99ab13c1d8..2bb63e849d1 100644 --- a/gdb/guile/scm-pretty-print.c +++ b/gdb/guile/scm-pretty-print.c @@ -858,7 +858,7 @@ ppscm_print_children (SCM printer, enum display_hint hint, if (pretty) { gdb_puts ("\n", stream); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else stream->wrap_here (2 + 2 *recurse); @@ -930,14 +930,14 @@ ppscm_print_children (SCM printer, enum display_hint hint, if (pretty) { gdb_puts ("\n", stream); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } gdb_puts ("...", stream); } if (pretty) { gdb_puts ("\n", stream); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } gdb_puts ("}", stream); } diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index fd8a96c9dd1..601d1fc26c3 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -562,7 +562,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, { QUIT; - print_spaces_filtered (level + 4, stream); + print_spaces (level + 4, stream); fputs_styled (type->field (i).name (), variable_name_style.style (), stream); gdb_puts (" : ", stream); diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index 0ef8c922606..f222f01b429 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -561,7 +561,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int } } - print_spaces_filtered (level + 4, stream); + print_spaces (level + 4, stream); if (field_is_static (&type->field (i))) gdb_printf (stream, "static "); print_type (type->field (i).type (), @@ -633,7 +633,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int } } - print_spaces_filtered (level + 4, stream); + print_spaces (level + 4, stream); if (TYPE_FN_FIELD_STATIC_P (f, j)) gdb_printf (stream, "static "); if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0) diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 68b5042ac52..eeb24454bd7 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -267,7 +267,7 @@ pascal_language::value_print_inner (struct value *val, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } } } @@ -559,7 +559,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); gdb_puts ("members of ", stream); gdb_puts (type->name (), stream); gdb_puts (": ", stream); @@ -570,7 +570,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else { @@ -671,7 +671,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } } gdb_printf (stream, "}"); @@ -762,7 +762,7 @@ pascal_object_print_value (struct value *val, struct ui_file *stream, if (options->prettyformat) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } gdb_puts ("<", stream); /* Not sure what the best notation is in the case where there is no diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index a88a9f5b9b6..c9bbd726412 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -471,7 +471,7 @@ print_children (PyObject *printer, const char *hint, if (pretty) { gdb_puts ("\n", stream); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else stream->wrap_here (2 + 2 *recurse); @@ -550,14 +550,14 @@ print_children (PyObject *printer, const char *hint, if (pretty) { gdb_puts ("\n", stream); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } gdb_puts ("...", stream); } if (pretty) { gdb_puts ("\n", stream); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } gdb_puts ("}", stream); } diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 8d1ecf0cdd7..e569f9369b8 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1038,7 +1038,7 @@ riscv_print_one_register_info (struct gdbarch *gdbarch, enum tab_stops { value_column_1 = 15 }; gdb_puts (name, file); - print_spaces_filtered (value_column_1 - strlen (name), file); + print_spaces (value_column_1 - strlen (name), file); try { diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 9ac29b85e8f..c78289c3244 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -372,7 +372,7 @@ rust_language::val_print_struct if (options->prettyformat) { gdb_puts ("\n", stream); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else if (!first_field) gdb_puts (" ", stream); @@ -393,7 +393,7 @@ rust_language::val_print_struct if (options->prettyformat) { gdb_puts ("\n", stream); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } if (is_tuple || is_tuple_struct) @@ -707,7 +707,7 @@ rust_print_struct_def (struct type *type, const char *varstring, /* For a tuple struct we print the type but nothing else. */ if (!for_rust_enum || flags->print_offsets) - print_spaces_filtered (level + 2, stream); + print_spaces (level + 2, stream); if (is_enum) fputs_styled (type->field (i).name (), variable_name_style.style (), stream); @@ -733,12 +733,12 @@ rust_print_struct_def (struct type *type, const char *varstring, /* Undo the temporary level increase we did above. */ level -= 2; podata->finish (type, level, stream); - print_spaces_filtered (print_offset_data::indentation, stream); + print_spaces (print_offset_data::indentation, stream); if (level == 0) - print_spaces_filtered (2, stream); + print_spaces (2, stream); } if (!for_rust_enum || flags->print_offsets) - print_spaces_filtered (level, stream); + print_spaces (level, stream); gdb_puts (is_tuple_struct ? ")" : "}", stream); } diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 55f79856643..1d3555ea2cd 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -506,7 +506,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, else section = NULL; - print_spaces_filtered (depth, outfile); + print_spaces (depth, outfile); if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN) { gdb_printf (outfile, "label %s at ", symbol->print_name ()); diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 27f4846f934..c52af125516 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -127,7 +127,7 @@ print_offset_data::update (struct type *type, unsigned int field_idx, { if (field_is_static (&type->field (field_idx))) { - print_spaces_filtered (indentation, stream); + print_spaces (indentation, stream); return; } @@ -188,7 +188,7 @@ print_offset_data::finish (struct type *type, int level, maybe_print_hole (stream, bitpos, "padding"); gdb_puts ("\n", stream); - print_spaces_filtered (level + 4 + print_offset_data::indentation, stream); + print_spaces (level + 4 + print_offset_data::indentation, stream); gdb_printf (stream, "/* total size (bytes): %4s */\n", pulongest (TYPE_LENGTH (type))); } diff --git a/gdb/utils.c b/gdb/utils.c index 31205b046a0..46b061ea6cf 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1921,7 +1921,7 @@ n_spaces (int n) /* Print N spaces. */ void -print_spaces_filtered (int n, struct ui_file *stream) +print_spaces (int n, struct ui_file *stream) { gdb_puts (n_spaces (n), stream); } diff --git a/gdb/utils.h b/gdb/utils.h index 621ac76ded5..e43ce3bcbd0 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -252,7 +252,7 @@ extern void gdb_printf (const char *, ...) ATTRIBUTE_PRINTF (1, 2); extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2); -extern void print_spaces_filtered (int, struct ui_file *); +extern void print_spaces (int, struct ui_file *); extern const char *n_spaces (int); diff --git a/gdb/valprint.c b/gdb/valprint.c index 42930f66896..0580a87c303 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -1936,7 +1936,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream, if (options->prettyformat_arrays) { gdb_printf (stream, ",\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } else gdb_printf (stream, ", "); @@ -1944,7 +1944,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream, else if (options->prettyformat_arrays) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 + 2 * recurse, stream); + print_spaces (2 + 2 * recurse, stream); } stream->wrap_here (2 + 2 * recurse); maybe_print_array_index (index_type, i + low_bound, @@ -1992,7 +1992,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream, if (options->prettyformat_arrays) { gdb_printf (stream, "\n"); - print_spaces_filtered (2 * recurse, stream); + print_spaces (2 * recurse, stream); } } -- 2.31.1