[binutils-gdb] gdb: convert 'debug skip' to the new(ish) debug scheme
Andrew Burgess
aburgess@sourceware.org
Wed Feb 25 11:30:41 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=36d3c88a94d180fb2c8c7620f6df7cb3b5c27b68
commit 36d3c88a94d180fb2c8c7620f6df7cb3b5c27b68
Author: Andrew Burgess <aburgess@redhat.com>
Date: Tue Feb 10 20:20:00 2026 +0000
gdb: convert 'debug skip' to the new(ish) debug scheme
Convert 'set debug skip' to use the newer debug scheme.
Approved-By: Tom Tromey <tom@tromey.com>
Diff:
---
gdb/skip.c | 39 ++++++++++++++++-----------------------
1 file changed, 16 insertions(+), 23 deletions(-)
diff --git a/gdb/skip.c b/gdb/skip.c
index ad191ef7a70..6ff044e43a8 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -45,6 +45,11 @@
skipping. */
static bool debug_skip = false;
+/* Print a "skip" debug statement. */
+
+#define skip_debug_printf(fmt, ...) \
+ debug_prefixed_printf_cond (debug_skip, "skip", fmt, ##__VA_ARGS__)
+
class skiplist_entry
{
public:
@@ -596,10 +601,8 @@ skip_delete_command (const char *arg, int from_tty)
bool
skiplist_entry::do_skip_file_p (const symtab_and_line &function_sal) const
{
- if (debug_skip)
- gdb_printf (gdb_stdlog,
- "skip: checking if file %s matches non-glob %s...",
- function_sal.symtab->filename (), m_file.c_str ());
+ skip_debug_printf ("checking if file %s matches non-glob %s",
+ function_sal.symtab->filename (), m_file.c_str ());
bool result;
@@ -623,8 +626,7 @@ skiplist_entry::do_skip_file_p (const symtab_and_line &function_sal) const
result = compare_filenames_for_search (fullname, m_file.c_str ());
}
- if (debug_skip)
- gdb_printf (gdb_stdlog, result ? "yes.\n" : "no.\n");
+ skip_debug_printf (result ? "yes" : "no");
return result;
}
@@ -632,10 +634,8 @@ skiplist_entry::do_skip_file_p (const symtab_and_line &function_sal) const
bool
skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const
{
- if (debug_skip)
- gdb_printf (gdb_stdlog,
- "skip: checking if file %s matches glob %s...",
- function_sal.symtab->filename (), m_file.c_str ());
+ skip_debug_printf ("checking if file %s matches glob %s",
+ function_sal.symtab->filename (), m_file.c_str ());
bool result;
@@ -663,8 +663,7 @@ skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const
result = compare_glob_filenames_for_search (fullname, m_file.c_str ());
}
- if (debug_skip)
- gdb_printf (gdb_stdlog, result ? "yes.\n" : "no.\n");
+ skip_debug_printf (result ? "yes" : "no");
return result;
}
@@ -694,10 +693,8 @@ skiplist_entry::skip_function_p (const char *function_name) const
if (m_function_is_regexp)
{
- if (debug_skip)
- gdb_printf (gdb_stdlog,
- "skip: checking if function %s matches regex %s...",
- function_name, m_function.c_str ());
+ skip_debug_printf ("checking if function %s matches regex %s",
+ function_name, m_function.c_str ());
gdb_assert (m_compiled_function_regexp);
result
@@ -705,16 +702,12 @@ skiplist_entry::skip_function_p (const char *function_name) const
}
else
{
- if (debug_skip)
- gdb_printf (gdb_stdlog,
- ("skip: checking if function %s matches non-regex "
- "%s..."),
- function_name, m_function.c_str ());
+ skip_debug_printf ("checking if function %s matches non-regex %s",
+ function_name, m_function.c_str ());
result = (strcmp_iw (function_name, m_function.c_str ()) == 0);
}
- if (debug_skip)
- gdb_printf (gdb_stdlog, result ? "yes.\n" : "no.\n");
+ skip_debug_printf (result ? "yes" : "no");
return result;
}
More information about the Gdb-cvs
mailing list