[1/9] Add block_search_flags

Message ID 20210325170458.2351251-2-tom@tromey.com
State New
Headers show
Series
  • Simplify quick_symbol_functions
Related show

Commit Message

Tom Tromey March 25, 2021, 5:04 p.m.
This adds block_search_flags, a flag enum.  This will be used to by
certain search functions so that the caller can control which blocks
are searched more precisely.

2021-03-25  Tom Tromey  <tom@tromey.com>

	* quick-symbol.h (enum block_search_flag_values): New.
	(block_search_flags): New enum flags type.
---
 gdb/ChangeLog      |  5 +++++
 gdb/quick-symbol.h | 10 ++++++++++
 2 files changed, 15 insertions(+)

-- 
2.26.2

Patch

diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h
index dd2b896fd5f..1ca4945bf60 100644
--- a/gdb/quick-symbol.h
+++ b/gdb/quick-symbol.h
@@ -20,6 +20,16 @@ 
 #ifndef GDB_QUICK_SYMBOL_H
 #define GDB_QUICK_SYMBOL_H
 
+/* Like block_enum, but used as flags to pass to lookup functions.  */
+
+enum block_search_flag_values
+{
+  SEARCH_GLOBAL_BLOCK = 1,
+  SEARCH_STATIC_BLOCK = 2
+};
+
+DEF_ENUM_FLAGS_TYPE (enum block_search_flag_values, block_search_flags);
+
 /* Comparison function for symbol look ups.  */
 
 typedef int (symbol_compare_ftype) (const char *string1,