From patchwork Wed Oct 16 23:27:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 35067 Received: (qmail 97868 invoked by alias); 16 Oct 2019 23:28:17 -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 97816 invoked by uid 89); 16 Oct 2019 23:28:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:29a X-HELO: mail-wm1-f41.google.com Received: from mail-wm1-f41.google.com (HELO mail-wm1-f41.google.com) (209.85.128.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Oct 2019 23:28:15 +0000 Received: by mail-wm1-f41.google.com with SMTP id v17so520600wml.4 for ; Wed, 16 Oct 2019 16:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=VLzvPgsN7Cnplr+i2G9bxgwInlN0UAs2slaDVnAfBjE=; b=TF9OStpzjBKEL3e3ySsm8Z/i653aiQvtkOX9/AnKw81MI76sxayhMihqtsR0ZoNWdS Afhzeb2piqv5PQpPPatQqeGty1h9SNxoSRNnZePVhGDMEBYSloaxs9Hg1gCHlWUbMSUJ Uybi7yXC9jruMGk8xZmliNnL7oMGb0koYZwbco19jcCIPEen5M3yYGlXYI+iLuYeyekQ zcGciOXx2JzNb5oxOWA/CfeWI16DsKEYVW92IaeErM6Y5qooU3MDzv+hothRIvMXlyLV lCM8lFYhKdcdk1C7ldNG+MHnQ2B38nrf3Ft2U1YhtJWqAS629/A/MvJbvnz4YQsOSzk4 FGAw== Return-Path: Received: from localhost (host86-128-12-122.range86-128.btcentralplus.com. [86.128.12.122]) by smtp.gmail.com with ESMTPSA id n22sm337315wmk.19.2019.10.16.16.28.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Oct 2019 16:28:12 -0700 (PDT) From: Andrew Burgess To: gdb-patches Cc: Andrew Burgess Subject: [PATCHv3 3/9] gdb: Don't print a newline in language la_print_typedef methods Date: Thu, 17 Oct 2019 00:27:58 +0100 Message-Id: <08eb55d1fad403bb70f24eb4f256fe0b07366702.1571268432.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes 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 --- gdb/ChangeLog | 12 ++++++++++++ gdb/ada-typeprint.c | 1 - gdb/c-typeprint.c | 2 +- gdb/f-typeprint.c | 1 - gdb/m2-typeprint.c | 2 +- gdb/p-typeprint.c | 2 +- gdb/rust-lang.c | 2 +- gdb/symtab.c | 6 ++---- 8 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index c2461660ad4..4c2e37c688b 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -954,5 +954,4 @@ ada_print_typedef (struct type *type, struct symbol *new_symbol, { 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 1a37c4edfb8..e0f1714da11 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -211,7 +211,7 @@ c_print_typedef (struct type *type, 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 0093aebddc2..027bcdde0f9 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -54,7 +54,6 @@ f_print_typedef (struct type *type, struct symbol *new_symbol, { 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 3c1a8d2aed3..e81a9e56888 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -170,7 +170,7 @@ m2_print_typedef (struct type *type, struct symbol *new_symbol, 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 fadc44eaee8..da30d4a3ac2 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -101,7 +101,7 @@ pascal_print_typedef (struct type *type, struct symbol *new_symbol, 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 cef0a9cb092..838d9019adf 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -831,7 +831,7 @@ rust_print_typedef (struct type *type, 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 67938cb818e..21ac57c39a9 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4766,10 +4766,8 @@ print_symbol_info (enum search_domain kind, 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