[binutils-gdb] gdb: move debug logging around in some skip related functions
Andrew Burgess via Gdb-cvs <[email protected]>
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c5396e72f2150f4ff2809b34791ba9dac67a61f5 commit c5396e72f2150f4ff2809b34791ba9dac67a61f5 Author: Andrew Burgess <[email protected]> Date: Tue Feb 10 11:10:38 2026 +0000 gdb: move debug logging around in some skip related functions Move the debug printing code out from skiplist_entry::do_skip_gfile_p and skiplist_entry::do_skip_file_p. This will make the next commit easier as we can switch to an early exit style function layout. There should be no user visible changes, even when 'set debug skip on' is in use, after this commit. Approved-By: Tom Tromey <[email protected]> Reviewed-By: Keith Seitz <[email protected]> Diff: --- gdb/skip.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/gdb/skip.c b/gdb/skip.c index 6ff044e43a8..06bf7ce485e 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -601,9 +601,6 @@ skip_delete_command (const char *arg, int from_tty) bool skiplist_entry::do_skip_file_p (const symtab_and_line &function_sal) const { - skip_debug_printf ("checking if file %s matches non-glob %s", - function_sal.symtab->filename (), m_file.c_str ()); - bool result; /* Check first sole SYMTAB->FILENAME. It may not be a substring of @@ -626,17 +623,12 @@ skiplist_entry::do_skip_file_p (const symtab_and_line &function_sal) const result = compare_filenames_for_search (fullname, m_file.c_str ()); } - skip_debug_printf (result ? "yes" : "no"); - return result; } bool skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const { - skip_debug_printf ("checking if file %s matches glob %s", - function_sal.symtab->filename (), m_file.c_str ()); - bool result; /* Check first sole SYMTAB->FILENAME. It may not be a substring of @@ -663,8 +655,6 @@ skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const result = compare_glob_filenames_for_search (fullname, m_file.c_str ()); } - skip_debug_printf (result ? "yes" : "no"); - return result; } @@ -677,10 +667,19 @@ skiplist_entry::skip_file_p (const symtab_and_line &function_sal) const if (function_sal.symtab == NULL) return false; + skip_debug_printf ("checking if file %s matches %sglob %s", + function_sal.symtab->filename (), + (m_file_is_glob ? "" : "non-"), m_file.c_str ()); + + bool result; if (m_file_is_glob) - return do_skip_gfile_p (function_sal); + result = do_skip_gfile_p (function_sal); else - return do_skip_file_p (function_sal); + result = do_skip_file_p (function_sal); + + skip_debug_printf (result ? "yes" : "no"); + + return result; } bool