From patchwork Thu Oct 31 23:06:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35550 Received: (qmail 92494 invoked by alias); 31 Oct 2019 23:06:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 92442 invoked by uid 89); 31 Oct 2019 23:06:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN autolearn=ham version=3.3.1 spammy=sk:I6e697e, sk:i6e697e, TYPE_CODE, type_code X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Oct 2019 23:06:25 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 6C1DD2047F; Thu, 31 Oct 2019 19:06:22 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 47C2020E94; Thu, 31 Oct 2019 19:06:11 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 2CB69218A2; Thu, 31 Oct 2019 19:06:11 -0400 (EDT) X-Gerrit-PatchSet: 2 Date: Thu, 31 Oct 2019 19:06:11 -0400 From: "Sourceware to Gerrit sync (Code Review)" To: Andrew Burgess , gdb-patches@sourceware.org Cc: Tom Tromey Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] gdb: Don't print a newline in language la_print_typedef methods X-Gerrit-Change-Id: I6e697ea1ec0eadaa31aefaea959b2055188d680d X-Gerrit-Change-Number: 263 X-Gerrit-ChangeURL: X-Gerrit-Commit: e170989694aecb458d1bbb6a1db6bb712ced707d In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, tromey@sourceware.org, andrew.burgess@embecosm.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Message-Id: <20191031230611.2CB69218A2@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/263 ...................................................................... gdb: Don't print a newline in language la_print_typedef methods When calling the language la_print_typedef method, don't include a newline at the end, instead print the newline from the users of la_print_typedef. This change will be useful in a later commit when the output from la_print_typedef will be placed into an MI output field, in which case the trailing newline is not required. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-typeprint.c (ada_print_typedef): Don't print newline at the end. * c-typeprint.c (c_print_typedef): Likewise. * f-typeprint.c (f_print_typedef): Likewise. * m2-typeprint.c (m2_print_typedef): Likewise. * p-typeprint.c (pascal_print_typedef): Likewise. * rust-lang.c (rust_print_typedef): Likewise. * symtab.c (print_symbol_info): Print a newline after calling typedef_print. Change-Id: I6e697ea1ec0eadaa31aefaea959b2055188d680d --- M gdb/ChangeLog M gdb/ada-typeprint.c M gdb/c-typeprint.c M gdb/f-typeprint.c M gdb/m2-typeprint.c M gdb/p-typeprint.c M gdb/rust-lang.c M gdb/symtab.c 8 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2bd6726..381147b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2019-10-31 Andrew Burgess + * ada-typeprint.c (ada_print_typedef): Don't print newline at the + end. + * c-typeprint.c (c_print_typedef): Likewise. + * f-typeprint.c (f_print_typedef): Likewise. + * m2-typeprint.c (m2_print_typedef): Likewise. + * p-typeprint.c (pascal_print_typedef): Likewise. + * rust-lang.c (rust_print_typedef): Likewise. + * symtab.c (print_symbol_info): Print a newline after calling + typedef_print. + +2019-10-31 Andrew Burgess + * symtab.c (info_module_cmdlist): New variable. (info_module_command): New function. (search_module_symbols): New function. diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index be37925..f89dd23 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -945,5 +945,4 @@ { type = ada_check_typedef (type); ada_print_type (type, "", stream, 0, 0, &type_print_raw_options); - fprintf_filtered (stream, "\n"); } diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 1a37c4e..e0f1714 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -211,7 +211,7 @@ SYMBOL_LINKAGE_NAME (new_symbol)) != 0 || TYPE_CODE (SYMBOL_TYPE (new_symbol)) == TYPE_CODE_TYPEDEF) fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new_symbol)); - fprintf_filtered (stream, ";\n"); + fprintf_filtered (stream, ";"); } /* If TYPE is a derived type, then print out derivation information. diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index 0093aeb..027bcdd 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -54,7 +54,6 @@ { type = check_typedef (type); f_print_type (type, "", stream, 0, 0, &type_print_raw_options); - fprintf_filtered (stream, "\n"); } /* LEVEL is the depth to indent lines by. */ diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 3c1a8d2..e81a9e5 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -170,7 +170,7 @@ else fprintf_filtered (stream, " = "); type_print (type, "", stream, 0); - fprintf_filtered (stream, ";\n"); + fprintf_filtered (stream, ";"); } /* m2_type_name - if a, type, has a name then print it. */ diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index fadc44e..da30d4a 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -101,7 +101,7 @@ fprintf_filtered (stream, "type "); fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol)); type_print (type, "", stream, 0); - fprintf_filtered (stream, ";\n"); + fprintf_filtered (stream, ";"); } /* If TYPE is a derived type, then print out derivation information. diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index cef0a9c..838d901 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -831,7 +831,7 @@ type = check_typedef (type); fprintf_filtered (stream, "type %s = ", SYMBOL_PRINT_NAME (new_symbol)); type_print (type, "", stream, 0); - fprintf_filtered (stream, ";\n"); + fprintf_filtered (stream, ";"); } /* la_print_type implementation for Rust. */ diff --git a/gdb/symtab.c b/gdb/symtab.c index 72a54ec..2c934b9 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4774,10 +4774,8 @@ if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_TYPEDEF) typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout); else - { - type_print (SYMBOL_TYPE (sym), "", gdb_stdout, -1); - printf_filtered ("\n"); - } + type_print (SYMBOL_TYPE (sym), "", gdb_stdout, -1); + printf_filtered ("\n"); } /* variable, func, or typedef-that-is-c++-class. */ else if (kind < TYPES_DOMAIN