[01/30] Introduce block-symbol.h

Message ID 20231029-split-objfile-2023-bound-sym-october-v1-1-612531df2734@tromey.com
State New
Headers
Series Baby step for objfile splitting |

Commit Message

Tom Tromey Oct. 29, 2023, 11:23 p.m. UTC
  This adds a new header file, block-symbol.h.  This is needed to break
include cycles in later patches.
---
 gdb/block-symbol.h | 39 +++++++++++++++++++++++++++++++++++++++
 gdb/symtab.h       | 14 +-------------
 2 files changed, 40 insertions(+), 13 deletions(-)
  

Patch

diff --git a/gdb/block-symbol.h b/gdb/block-symbol.h
new file mode 100644
index 00000000000..35bc40c1986
--- /dev/null
+++ b/gdb/block-symbol.h
@@ -0,0 +1,39 @@ 
+/* The block_symbol type
+
+   Copyright (C) 2023 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef GDB_BLOCK_SYMBOL_H
+#define GDB_BLOCK_SYMBOL_H
+
+struct block;
+struct symbol;
+
+/* Several lookup functions return both a symbol and the block in which the
+   symbol is found.  This structure is used in these cases.  */
+
+struct block_symbol
+{
+  /* The symbol that was found, or NULL if no symbol was found.  */
+  struct symbol *symbol;
+
+  /* If SYMBOL is not NULL, then this is the block in which the symbol is
+     defined.  */
+  const struct block *block;
+};
+
+#endif /* GDB_BLOCK_SYMBOL_H */
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 8dfc873b1c9..0b3ca3964b6 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -38,6 +38,7 @@ 
 #include "gdb-demangle.h"
 #include "split-name.h"
 #include "frame.h"
+#include "block-symbol.h"
 
 /* Opaque declarations.  */
 struct ui_file;
@@ -1521,19 +1522,6 @@  struct symbol : public general_symbol_info, public allocate_on_obstack
  CORE_ADDR get_maybe_copied_address () const;
 };
 
-/* Several lookup functions return both a symbol and the block in which the
-   symbol is found.  This structure is used in these cases.  */
-
-struct block_symbol
-{
-  /* The symbol that was found, or NULL if no symbol was found.  */
-  struct symbol *symbol;
-
-  /* If SYMBOL is not NULL, then this is the block in which the symbol is
-     defined.  */
-  const struct block *block;
-};
-
 /* Note: There is no accessor macro for symbol.owner because it is
    "private".  */