aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-08-11 12:11:28 +0100
committerPedro Alves <palves@redhat.com>2017-08-11 12:11:28 +0100
commitde7985c3cca1358b21b49a9872455e2032f48ee3 (patch)
tree5480a35da9833bf2e31b5edbb8a3106d0be9fa07 /gdb/skip.h
parentReset *THIS_CACHE in frame_unwind_try_unwinder in case of exception (diff)
downloadbinutils-gdb-de7985c3cca1358b21b49a9872455e2032f48ee3.tar.gz
binutils-gdb-de7985c3cca1358b21b49a9872455e2032f48ee3.tar.bz2
binutils-gdb-de7985c3cca1358b21b49a9872455e2032f48ee3.zip
More gdb/skip.c C++ification
- Make skiplist_entry a class with private data members. - Move all construction logic to the ctor. - Make skip_file_p etc be methods of skiplist_entry. - Use std::list for the skip entries chain. Make the list own its elements. - Get rid of the ALL_SKIPLIST_ENTRIES/ALL_SKIPLIST_ENTRIES_SAFE macros, use range-for / iterators instead. - function_name_is_marked_for_skip 'function_sal' argument must be non-NULL, so make it a reference instead. All skiplist_entry invariants are now controlled by skiplist_entry methods/internals. Some gdb_asserts disappear for being redundant. gdb/ChangeLog: 2017-08-11 Pedro Alves <palves@redhat.com> * infrun.c (process_event_stop_test): Adjust function_name_is_marked_for_skip call. * skip.c: Include <list>. (skiplist_entry): Make it a class with private fields, and getters/setters. (skiplist_entry_chain): Delete. (skiplist_entries): New. (skiplist_entry_count): Delete. (highest_skiplist_entry_num): New. (ALL_SKIPLIST_ENTRIES, ALL_SKIPLIST_ENTRIES_SAFE): Delete. (add_skiplist_entry): Delete. (skiplist_entry::skiplist_entry): New. (skiplist_entry::add_entry): New. (skip_file_command, skip_function): Adjust. (compile_skip_regexp): Delete. (skip_command): Don't compile regexp here. Adjust to use skiplist_entry::add_entry. (skip_info): Adjust to use range-for and getters. (skip_enable_command, skip_disable_command): Adjust to use range-for and setters. (skip_delete_command): Adjust to use std::list. (add_skiplist_entry): Delete. (skip_file_p): Delete, refactored as ... (skiplist_entry::do_skip_file_p): ... this new method. (skip_gfile_p): Delete, refactored as ... (skiplist_entry::do_gskip_file_p): ... this new method. (skip_function_p, skip_rfunction_p): Delete, refactored as ... (skiplist_entry::skip_function_p): ... this new method. (function_name_is_marked_for_skip): Now returns bool, and takes the function sal by const reference. Adjust to use range-for and skiplist_entry methods. (_initialize_step_skip): Remove references to skiplist_entry_chain, skiplist_entry_count. * skip.h (function_name_is_marked_for_skip): Now returns bool, and takes the function sal by const reference.
Diffstat (limited to 'gdb/skip.h')
-rw-r--r--gdb/skip.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/skip.h b/gdb/skip.h
index dbc92d809eb..4e1b544dd74 100644
--- a/gdb/skip.h
+++ b/gdb/skip.h
@@ -20,9 +20,9 @@
struct symtab_and_line;
-/* Returns 1 if the given FUNCTION_NAME is marked for skip and shouldn't be
- stepped into. Otherwise, returns 0. */
-int function_name_is_marked_for_skip (const char *function_name,
- const struct symtab_and_line *function_sal);
+/* Returns true if the given FUNCTION_NAME is marked for skip and
+ shouldn't be stepped into. Otherwise, returns false. */
+bool function_name_is_marked_for_skip (const char *function_name,
+ const symtab_and_line &function_sal);
#endif /* !defined (SKIP_H) */