From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches <gdb-patches@sourceware.org>
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 1/3] gdb: Don't print a newline in language la_print_typedef methods
Date: Thu, 26 Sep 2019 23:09:00 -0000 [thread overview]
Message-ID: <bbc7ec4d78e8a4eb8ee8d843f9353016d9215758.1569539198.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1569539198.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1569539198.git.andrew.burgess@embecosm.com>
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.
---
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 89a69e9bd44..f14a41fe835 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -951,5 +951,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 43ad3b3e0e6..c89acd4a7cd 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 92b50938740..f7813d660ca 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -53,7 +53,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 dae07d1c531..968d02a76a1 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -169,7 +169,7 @@ m2_print_typedef (struct type *type, struct symbol *new_symbol,
else
fprintf_filtered (stream, "<builtin> = ");
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 d90b8ceb6ea..504ba477f91 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -100,7 +100,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 79f13311cd8..518c667345a 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -828,7 +828,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 6ea9fc6971e..b4316479f53 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4777,10 +4777,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
--
2.14.5
next prev parent reply other threads:[~2019-09-26 23:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 23:09 [PATCH 0/3] New MI commands for info functions/types/variables Andrew Burgess
2019-09-26 23:09 ` [PATCH 2/3] gdb: Split print_symbol_info into two parts Andrew Burgess
2019-10-04 1:50 ` Simon Marchi
2019-09-26 23:09 ` Andrew Burgess [this message]
2019-09-26 23:09 ` [PATCH 3/3] gdb/mi: Add new commands -symbol-info-{functions,variables,types} Andrew Burgess
2019-09-27 5:43 ` Eli Zaretskii
2019-10-04 3:01 ` Simon Marchi
2019-10-04 13:46 ` André Pönitz
2019-10-11 12:32 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bbc7ec4d78e8a4eb8ee8d843f9353016d9215758.1569539198.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox