aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-02 11:36:44 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commit0426ad513f93bb1c5805988e60d6f87fbe738860 (patch)
tree6ad0f94f9b2a907623df38db9dd7727fe80f5d51 /gdb/python
parent19a7b8ab871b92dee32a0ebffe274388d3426564 (diff)
downloadgdb-0426ad513f93bb1c5805988e60d6f87fbe738860.zip
gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.gz
gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.bz2
Unify gdb puts functions
Now that filtered and unfiltered output can be treated identically, we can unify the puts family of functions. This is done under the name "gdb_puts". Most of this patch was written by script.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-framefilter.c4
-rw-r--r--gdb/python/py-prettyprint.c28
2 files changed, 16 insertions, 16 deletions
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 0170fe6..c9b5dd5 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -348,12 +348,12 @@ py_print_single_arg (struct ui_out *out,
{
string_file stb;
- fputs_filtered (fa->sym->print_name (), &stb);
+ gdb_puts (fa->sym->print_name (), &stb);
if (fa->entry_kind == print_entry_values_compact)
{
stb.puts ("=");
- fputs_filtered (fa->sym->print_name (), &stb);
+ gdb_puts (fa->sym->print_name (), &stb);
}
if (fa->entry_kind == print_entry_values_only
|| fa->entry_kind == print_entry_values_compact)
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 8d37868..16277cc 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -321,7 +321,7 @@ print_string_repr (PyObject *printer, const char *hint,
language->printstr (stream, type, (gdb_byte *) output,
length, NULL, 0, options);
else
- fputs_filtered (output, stream);
+ gdb_puts (output, stream);
}
else
{
@@ -439,10 +439,10 @@ print_children (PyObject *printer, const char *hint,
if (i == 0)
{
if (!is_py_none)
- fputs_filtered (" = ", stream);
+ gdb_puts (" = ", stream);
}
else if (! is_map || i % 2 == 0)
- fputs_filtered (pretty ? "," : ", ", stream);
+ gdb_puts (pretty ? "," : ", ", stream);
/* Skip printing children if max_depth has been reached. This check
is performed after print_string_repr and the "=" separator so that
@@ -452,7 +452,7 @@ print_children (PyObject *printer, const char *hint,
return;
else if (i == 0)
/* Print initial "{" to bookend children. */
- fputs_filtered ("{", stream);
+ gdb_puts ("{", stream);
/* In summary mode, we just want to print "= {...}" if there is
a value. */
@@ -470,7 +470,7 @@ print_children (PyObject *printer, const char *hint,
{
if (pretty)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
@@ -478,7 +478,7 @@ print_children (PyObject *printer, const char *hint,
}
if (is_map && i % 2 == 0)
- fputs_filtered ("[", stream);
+ gdb_puts ("[", stream);
else if (is_array)
{
/* We print the index, not whatever the child method
@@ -488,8 +488,8 @@ print_children (PyObject *printer, const char *hint,
}
else if (! is_map)
{
- fputs_filtered (name, stream);
- fputs_filtered (" = ", stream);
+ gdb_puts (name, stream);
+ gdb_puts (" = ", stream);
}
if (gdbpy_is_lazy_string (py_v))
@@ -514,7 +514,7 @@ print_children (PyObject *printer, const char *hint,
if (!output)
gdbpy_print_stack ();
else
- fputs_filtered (output.get (), stream);
+ gdb_puts (output.get (), stream);
}
else
{
@@ -540,7 +540,7 @@ print_children (PyObject *printer, const char *hint,
}
if (is_map && i % 2 == 0)
- fputs_filtered ("] = ", stream);
+ gdb_puts ("] = ", stream);
}
if (i)
@@ -549,17 +549,17 @@ print_children (PyObject *printer, const char *hint,
{
if (pretty)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream);
}
- fputs_filtered ("...", stream);
+ gdb_puts ("...", stream);
}
if (pretty)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream);
}
- fputs_filtered ("}", stream);
+ gdb_puts ("}", stream);
}
}