From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11537 invoked by alias); 19 Feb 2003 22:59:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11523 invoked from network); 19 Feb 2003 22:59:25 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 19 Feb 2003 22:59:25 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h1JMxOl10811; Wed, 19 Feb 2003 14:59:24 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb-patches@sources.redhat.com Cc: Jim Blandy , Elena Zannoni Subject: [rfa] block.{c,h} From: David Carlton Date: Wed, 19 Feb 2003 22:59:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00447.txt.bz2 Following my recent RFC, here's an RFA for creating block.h and block.c. block.h contains: * The definitions of struct block and struct blockvector, moved from symtab.h. * Their associated macros, moved from symtab.h. * Declarations of block_function, contained_in, blockvector_for_pc, blockvector_for_pc_sect, block_for_pc, and block_for_pc_sect, moved from symtab.h or frame.h block.c contains: * The definitions for the aforementioned functions, moved from symtab.c or blockframe.c. I also updated all of the include files that included the string 'struct block' to have an opaque declaration of struct block and/or struc blockvector, as appropriate, added block.c and block.h to Makefile.in, added #include "block.h" to all files that needed it, and had those files depend on $(block_h) in Makefile.in. So almost all of this is routine cutting and pasting. The one potentially delicate bit is making sure that I #included block.h everywhere. I actually applied a variant of this patch to my branch a few months ago; so what I did this time was included block.h in every file that I was including it in on my branch. (I used keyboard macros as much as possible, to avoid typos.) I regularly do an all-targets build on my branch, so I'm optimistic that block.h is included everywhere that it should be; if I missed a file (e.g. if a target-specific file has been modified since the last time I merged my branch with mainline, a couple of weeks ago), that will be easy enough to fix. Once I added all those #include statements, I then updated the Makefile dependencies; again, I used keyboard macros as much as possible, to avoid typos. I then compiled and tested on i686-pc-linux-gnu/GCC3.1/DWARF-2; no new regressions. My apologies for not doing an all-targets build to test it: I don't really have the resources on this computer to do an all-targets build for mainline, and I'm pretty sure that doing the all-targets build on a branch should have caught potential problems. OK to commit? David Carlton carlton@math.stanford.edu 2003-02-19 David Carlton * Makefile.in (SFILES): block.c (block_h): New. (COMMON_OBS): block.o (block.o): New. (x86-64-tdep.o): Add block_h. (values.o): Ditto. (valops.o): Ditto. (tracepoint.o): Ditto. (symtab.o): Ditto. (symmisc.o): Ditto. (symfile.o): Ditto. (stack.o): Ditto. (printcmd.o): Ditto. (p-exp.tab.o): Ditto. (parse.o): Ditto. (objfiles.o): Ditto. (objc-exp.tab.o): Ditto. (objc-lang.o): Ditto. (nlmread.o): Ditto. (mips-tdep.o): Ditto. (mdebugread.o): Ditto. (m2-exp.tab.o): Ditto. (linespec.o): Ditto. (jv-lang.o): Ditto. (jv-exp.tab.o): Ditto. (infcmd.o): Ditto. (f-valprint.o): Ditto. (findvar.o): Ditto. (f-exp.tab.o): Ditto. (expprint.o): Ditto. (coffread.o): Ditto. (c-exp.tab.o): Ditto. (buildsym.o): Ditto. (breakpoint.o): Ditto. (blockframe.o): Ditto. (ax-gdb.o): Ditto. (alpha-tdep.o): Ditto. (ada-lang.o): Ditto. (ada-exp.tab.o): Ditto. (mi-cmd-stack.o): Ditto. * value.h: Add opaque declaration for struct block. * parser-defs.h: Ditto. * objc-lang.h: Ditto. * buildsym.h: Ditto. * breakpoint.h: Ditto. * ada-lang.h: Ditto. * x86-64-tdep.c: #include "block.h" * values.c: Ditto. * valops.c: Ditto. * tracepoint.c: Ditto. * symtab.c: Ditto. * symmisc.c: Ditto. * symfile.c: Ditto. * stack.c: Ditto. * printcmd.c: Ditto. * p-exp.y: Ditto. * parse.c: Ditto. * objfiles.c: Ditto. * objc-exp.y: Ditto. * objc-lang.c: Ditto. * nlmread.c: Ditto. * mips-tdep.c: Ditto. * mdebugread.c: Ditto. * m2-exp.y: Ditto. * linespec.c: Ditto. * jv-lang.c: Ditto. * jv-exp.y: Ditto. * infcmd.c: Ditto. * f-valprint.c: Ditto. * findvar.c: Ditto. * f-exp.y: Ditto. * expprint.c: Ditto. * coffread.c: Ditto. * c-exp.y: Ditto. * buildsym.c: Ditto. * breakpoint.c: Ditto. * blockframe.c: Ditto. * ax-gdb.c: Ditto. * alpha-tdep.c: Ditto. * ada-lang.c: Ditto. * ada-exp.y: Ditto. * blockframe.c: Move blockvector_for_pc_sect, blockvector_for_pc, block_for_pc_sect, block_for_pc to block.c. * symtab.c: Move block_function, contained_in to block.c. * frame.h: Move block_for_pc and block_for_pc_sect declarations to block.h. Add opaque declaration for struct block. * symtab.h: Move block-related stuff to block.h. Add opaque declarations for struct block, struct blockvector. * block.c: New file. * block.h: New file. 2003-02-19 David Carlton * mi-cmd-stack.c: #include "block.h" --- /dev/null Thu Apr 11 07:25:15 2002 +++ block.h Wed Feb 19 13:49:31 2003 @@ -0,0 +1,178 @@ +/* Code dealing with blocks for GDB. + + Copyright 2003 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Opaque declarations. */ + +struct symbol; +struct symtab; + +/* All of the name-scope contours of the program + are represented by `struct block' objects. + All of these objects are pointed to by the blockvector. + + Each block represents one name scope. + Each lexical context has its own block. + + The blockvector begins with some special blocks. + The GLOBAL_BLOCK contains all the symbols defined in this compilation + whose scope is the entire program linked together. + The STATIC_BLOCK contains all the symbols whose scope is the + entire compilation excluding other separate compilations. + Blocks starting with the FIRST_LOCAL_BLOCK are not special. + + Each block records a range of core addresses for the code that + is in the scope of the block. The STATIC_BLOCK and GLOBAL_BLOCK + give, for the range of code, the entire range of code produced + by the compilation that the symbol segment belongs to. + + The blocks appear in the blockvector + in order of increasing starting-address, + and, within that, in order of decreasing ending-address. + + This implies that within the body of one function + the blocks appear in the order of a depth-first tree walk. */ + +struct block +{ + + /* Addresses in the executable code that are in this block. */ + + CORE_ADDR startaddr; + CORE_ADDR endaddr; + + /* The symbol that names this block, if the block is the body of a + function; otherwise, zero. */ + + struct symbol *function; + + /* The `struct block' for the containing block, or 0 if none. + + The superblock of a top-level local block (i.e. a function in the + case of C) is the STATIC_BLOCK. The superblock of the + STATIC_BLOCK is the GLOBAL_BLOCK. */ + + struct block *superblock; + + /* Version of GCC used to compile the function corresponding + to this block, or 0 if not compiled with GCC. When possible, + GCC should be compatible with the native compiler, or if that + is not feasible, the differences should be fixed during symbol + reading. As of 16 Apr 93, this flag is never used to distinguish + between gcc2 and the native compiler. + + If there is no function corresponding to this block, this meaning + of this flag is undefined. */ + + unsigned char gcc_compile_flag; + + /* The symbols for this block are either in a simple linear list or + in a simple hashtable. Blocks which correspond to a function + (which have a list of symbols corresponding to arguments) use + a linear list, as do some older symbol readers (currently only + mdebugread and dstread). Other blocks are hashed. + + The hashtable uses the same hash function as the minsym hashtables, + found in minsyms.c:minsym_hash_iw. Symbols are hashed based on + their demangled name if appropriate, and on their name otherwise. + The hash function ignores space, and stops at the beginning of the + argument list if any. + + The table is laid out in NSYMS/5 buckets and symbols are chained via + their hash_next field. */ + + /* If this is really a hashtable of the symbols, this flag is 1. */ + + unsigned char hashtable; + + /* Number of local symbols. */ + + int nsyms; + + /* The symbols. If some of them are arguments, then they must be + in the order in which we would like to print them. */ + + struct symbol *sym[1]; +}; + +#define BLOCK_START(bl) (bl)->startaddr +#define BLOCK_END(bl) (bl)->endaddr +#define BLOCK_FUNCTION(bl) (bl)->function +#define BLOCK_SUPERBLOCK(bl) (bl)->superblock +#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag +#define BLOCK_HASHTABLE(bl) (bl)->hashtable + +/* For blocks without a hashtable (BLOCK_HASHTABLE (bl) == 0) only. */ +#define BLOCK_NSYMS(bl) (bl)->nsyms +#define BLOCK_SYM(bl, n) (bl)->sym[n] + +/* For blocks with a hashtable, but these are valid for non-hashed blocks as + well - each symbol will appear to be one bucket by itself. */ +#define BLOCK_BUCKETS(bl) (bl)->nsyms +#define BLOCK_BUCKET(bl, n) (bl)->sym[n] + +/* Macro used to set the size of a hashtable for N symbols. */ +#define BLOCK_HASHTABLE_SIZE(n) ((n)/5 + 1) + +/* Macro to loop through all symbols in a block BL, in no particular order. + i counts which bucket we are in, and sym points to the current symbol. */ + +#define ALL_BLOCK_SYMBOLS(bl, i, sym) \ + for ((i) = 0; (i) < BLOCK_BUCKETS ((bl)); (i)++) \ + for ((sym) = BLOCK_BUCKET ((bl), (i)); (sym); \ + (sym) = (sym)->hash_next) + +/* Nonzero if symbols of block BL should be sorted alphabetically. + Don't sort a block which corresponds to a function. If we did the + sorting would have to preserve the order of the symbols for the + arguments. Also don't sort any block that we chose to hash. */ + +#define BLOCK_SHOULD_SORT(bl) (! BLOCK_HASHTABLE (bl) \ + && BLOCK_FUNCTION (bl) == NULL) + +struct blockvector +{ + /* Number of blocks in the list. */ + int nblocks; + /* The blocks themselves. */ + struct block *block[1]; +}; + +#define BLOCKVECTOR_NBLOCKS(blocklist) (blocklist)->nblocks +#define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n] + +/* Special block numbers */ + +#define GLOBAL_BLOCK 0 +#define STATIC_BLOCK 1 +#define FIRST_LOCAL_BLOCK 2 + +extern struct symbol *block_function (struct block *); + +extern int contained_in (struct block *, struct block *); + +extern struct blockvector *blockvector_for_pc (CORE_ADDR, int *); + +extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, asection *, + int *, struct symtab *); + +extern struct block *block_for_pc (CORE_ADDR); + +extern struct block *block_for_pc_sect (CORE_ADDR, asection *); --- /dev/null Thu Apr 11 07:25:15 2002 +++ block.c Wed Feb 19 14:15:38 2003 @@ -0,0 +1,141 @@ +/* Block-related functions for the GNU debugger, GDB. + + Copyright 2003 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "block.h" +#include "symtab.h" +#include "symfile.h" + +/* Return Nonzero if block a is lexically nested within block b, + or if a and b have the same pc range. + Return zero otherwise. */ + +int +contained_in (struct block *a, struct block *b) +{ + if (!a || !b) + return 0; + return BLOCK_START (a) >= BLOCK_START (b) + && BLOCK_END (a) <= BLOCK_END (b); +} + + +/* Return the symbol for the function which contains a specified + lexical block, described by a struct block BL. */ + +struct symbol * +block_function (struct block *bl) +{ + while (BLOCK_FUNCTION (bl) == 0 && BLOCK_SUPERBLOCK (bl) != 0) + bl = BLOCK_SUPERBLOCK (bl); + + return BLOCK_FUNCTION (bl); +} + +/* Return the blockvector immediately containing the innermost lexical block + containing the specified pc value and section, or 0 if there is none. + PINDEX is a pointer to the index value of the block. If PINDEX + is NULL, we don't pass this information back to the caller. */ + +struct blockvector * +blockvector_for_pc_sect (register CORE_ADDR pc, struct sec *section, + int *pindex, struct symtab *symtab) +{ + register struct block *b; + register int bot, top, half; + struct blockvector *bl; + + if (symtab == 0) /* if no symtab specified by caller */ + { + /* First search all symtabs for one whose file contains our pc */ + if ((symtab = find_pc_sect_symtab (pc, section)) == 0) + return 0; + } + + bl = BLOCKVECTOR (symtab); + b = BLOCKVECTOR_BLOCK (bl, 0); + + /* Then search that symtab for the smallest block that wins. */ + /* Use binary search to find the last block that starts before PC. */ + + bot = 0; + top = BLOCKVECTOR_NBLOCKS (bl); + + while (top - bot > 1) + { + half = (top - bot + 1) >> 1; + b = BLOCKVECTOR_BLOCK (bl, bot + half); + if (BLOCK_START (b) <= pc) + bot += half; + else + top = bot + half; + } + + /* Now search backward for a block that ends after PC. */ + + while (bot >= 0) + { + b = BLOCKVECTOR_BLOCK (bl, bot); + if (BLOCK_END (b) > pc) + { + if (pindex) + *pindex = bot; + return bl; + } + bot--; + } + return 0; +} + +/* Return the blockvector immediately containing the innermost lexical block + containing the specified pc value, or 0 if there is none. + Backward compatibility, no section. */ + +struct blockvector * +blockvector_for_pc (register CORE_ADDR pc, int *pindex) +{ + return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc), + pindex, NULL); +} + +/* Return the innermost lexical block containing the specified pc value + in the specified section, or 0 if there is none. */ + +struct block * +block_for_pc_sect (register CORE_ADDR pc, struct sec *section) +{ + register struct blockvector *bl; + int index; + + bl = blockvector_for_pc_sect (pc, section, &index, NULL); + if (bl) + return BLOCKVECTOR_BLOCK (bl, index); + return 0; +} + +/* Return the innermost lexical block containing the specified pc value, + or 0 if there is none. Backward compatibility, no section. */ + +struct block * +block_for_pc (register CORE_ADDR pc) +{ + return block_for_pc_sect (pc, find_pc_mapped_section (pc)); +} Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.332 diff -u -p -r1.332 Makefile.in --- Makefile.in 18 Feb 2003 23:27:42 -0000 1.332 +++ Makefile.in 19 Feb 2003 22:26:42 -0000 @@ -511,7 +511,7 @@ TARGET_FLAGS_TO_PASS = \ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ ax-general.c ax-gdb.c \ - bcache.c blockframe.c breakpoint.c buildsym.c builtin-regs.c \ + bcache.c block.c blockframe.c breakpoint.c buildsym.c builtin-regs.c \ c-exp.y c-lang.c c-typeprint.c c-valprint.c \ charset.c cli-out.c coffread.c complaints.c completer.c corefile.c \ cp-abi.c cp-support.c cp-valprint.c \ @@ -606,6 +606,7 @@ arm_tdep_h = arm-tdep.h ax_gdb_h = ax-gdb.h ax_h = ax.h $(doublest_h) bcache_h = bcache.h +block_h = block.h breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) buildsym_h = buildsym.h builtin_regs_h = builtin-regs.h @@ -824,7 +825,7 @@ TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRC COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ charset.o disasm.o dummy-frame.o \ source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ - symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ + block.o symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ expprint.o environ.o stack.o thread.o \ interps.o \ macrotab.o macrocmd.o macroexp.o macroscope.o \ @@ -1431,32 +1432,32 @@ z8k-tdep.o: $(srcdir)/z8k-tdep.c c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \ $(charset_h) \ - $(symfile_h) $(objfiles_h) + $(symfile_h) $(objfiles_h) $(block_h) objc-exp.tab.o: objc-exp.tab.c $(objc_lang_h) $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \ - $(symfile_h) + $(symfile_h) $(block_h) m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \ $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ - $(bfd_h) objfiles.h symfile.h + $(bfd_h) objfiles.h symfile.h $(block_h) # # The dependencies. In aphabetic order. @@ -1467,7 +1468,7 @@ abug-rom.o: abug-rom.c $(defs_h) $(gdbco ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \ $(gdbtypes_h) $(gdbcmd_h) $(expression_h) $(parser_defs_h) \ $(language_h) $(c_lang_h) $(inferior_h) $(symfile_h) $(objfiles_h) \ - $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(ui_out_h) + $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(ui_out_h) $(block_h) ada-tasks.o: ada-tasks.c $(defs_h) $(command_h) $(value_h) $(language_h) \ $(inferior_h) $(symtab_h) $(target_h) $(gdbcore_h) $(gregset_h) \ $(ada_lang_h) @@ -1491,7 +1492,7 @@ alpha-tdep.o: alpha-tdep.c $(defs_h) $(f $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) $(symfile_h) \ $(objfiles_h) $(gdb_string_h) $(linespec_h) $(regcache_h) \ $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) \ - $(osabi_h) + $(osabi_h) $(block_h) alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(alpha_tdep_h) $(alphabsd_tdep_h) $(gregset_h) alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \ @@ -1527,24 +1528,26 @@ avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcm $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ $(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \ - $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) + $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h) bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) +block.o: block.c $(defs_h) $(block_h) $(symtab_h) $(symfile_h) blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \ $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \ - $(dummy_frame_h) $(command_h) $(gdbcmd_h) + $(dummy_frame_h) $(command_h) $(gdbcmd_h) $(block_h) breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ $(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \ $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ $(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \ $(objfiles_h) $(linespec_h) $(completer_h) $(gdb_h) $(ui_out_h) \ - $(cli_script_h) $(gdb_events_h) $(source_h) $(gdb_assert_h) + $(cli_script_h) $(gdb_events_h) $(source_h) $(gdb_assert_h) \ + $(block_h) buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(gdb_assert_h) \ $(complaints_h) $(gdb_string_h) $(expression_h) $(language_h) \ $(bcache_h) $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ - $(stabsread_h) + $(stabsread_h) $(block_h) builtin-regs.o: builtin-regs.c $(defs_h) $(builtin_regs_h) $(gdbtypes_h) \ $(gdb_string_h) $(gdb_assert_h) c-lang.o: c-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1567,7 +1570,7 @@ coffread.o: coffread.c $(defs_h) $(symta $(breakpoint_h) $(bfd_h) $(gdb_obstack_h) $(gdb_string_h) \ $(coff_internal_h) $(libcoff_h) $(symfile_h) $(objfiles_h) \ $(buildsym_h) $(gdb_stabs_h) $(stabsread_h) $(complaints_h) \ - $(target_h) $(gdb_assert_h) + $(target_h) $(gdb_assert_h) $(block_h) complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \ $(command_h) $(gdbcmd_h) completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1654,7 +1657,8 @@ exec.o: exec.c $(defs_h) $(frame_h) $(in $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) \ $(readline_h) expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ - $(value_h) $(language_h) $(parser_defs_h) $(target_h) $(gdb_string_h) + $(value_h) $(language_h) $(parser_defs_h) $(target_h) $(gdb_string_h) \ + $(block_h) f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ $(valprint_h) @@ -1663,13 +1667,13 @@ f-typeprint.o: f-typeprint.c $(defs_h) $ $(f_lang_h) $(gdb_string_h) f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ - $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) + $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) $(block_h) fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(gdb_string_h) $(elf_bfd_h) $(gregset_h) findvar.o: findvar.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(frame_h) \ $(value_h) $(gdbcore_h) $(inferior_h) $(target_h) $(gdb_string_h) \ $(gdb_assert_h) $(floatformat_h) $(symfile_h) $(regcache_h) \ - $(builtin_regs_h) + $(builtin_regs_h) $(block_h) fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \ $(terminal_h) $(gdbthread_h) $(command_h) @@ -1791,7 +1795,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_strin $(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \ $(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \ $(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \ - $(parser_defs_h) $(regcache_h) + $(parser_defs_h) $(regcache_h) $(block_h) inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \ $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \ $(inflow_h) @@ -1816,7 +1820,7 @@ irix5-nat.o: irix5-nat.c $(defs_h) $(inf jv-lang.o: jv-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \ - $(jv_lang_h) $(gdbcore_h) + $(jv_lang_h) $(gdbcore_h) $(block_h) jv-typeprint.o: jv-typeprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(demangle_h) $(jv_lang_h) $(gdb_string_h) $(typeprint_h) \ $(c_lang_h) $(cp_abi_h) @@ -1833,7 +1837,7 @@ lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_ass $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(completer_h) \ - $(cp_abi_h) $(source_h) $(parser_defs_h) + $(cp_abi_h) $(source_h) $(parser_defs_h) $(block_h) linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) \ $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \ $(cli_decode_h) $(gdb_string_h) @@ -1896,6 +1900,7 @@ mcore-tdep.o: mcore-tdep.c $(defs_h) $(f mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \ $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \ + $(block_h) \ $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \ $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \ $(aout_stab_gnu_h) $(expression_h) $(language_h) @@ -1914,7 +1919,7 @@ mips-nat.o: mips-nat.c $(defs_h) $(infer mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ - $(regcache_h) $(osabi_h) $(mips_tdep_h) $(opcode_mips_h) \ + $(regcache_h) $(osabi_h) $(mips_tdep_h) $(block_h) $(opcode_mips_h) \ $(elf_mips_h) $(elf_bfd_h) $(symcat_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ @@ -1939,7 +1944,7 @@ monitor.o: monitor.c $(defs_h) $(gdbcore $(gdb_regex_h) $(srec_h) $(regcache_h) nbsd-tdep.o: nbsd-tdep.c $(defs_h) $(gdb_string_h) $(solib_svr4_h) nlmread.o: nlmread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ - $(objfiles_h) $(buildsym_h) $(stabsread_h) + $(objfiles_h) $(buildsym_h) $(stabsread_h) $(block_h) ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \ $(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) \ $(ns32k_tdep_h) $(gdb_string_h) $(osabi_h) @@ -1951,10 +1956,11 @@ objc-lang.o: objc-lang.c $(defs_h) $(sym $(parser_defs_h) $(language_h) $(c_lang_h) $(objc_lang_h) \ $(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) \ - $(gdb_regex_h) $(regcache_h) + $(gdb_regex_h) $(regcache_h) $(block_h) objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ - $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) + $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) \ + $(block_h) ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \ $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h) @@ -1979,7 +1985,7 @@ pa64solib.o: pa64solib.c $(defs_h) $(fra parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \ $(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \ - $(doublest_h) $(builtin_regs_h) $(gdb_assert_h) + $(doublest_h) $(builtin_regs_h) $(gdb_assert_h) $(block_h) ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ $(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \ @@ -2004,7 +2010,7 @@ printcmd.o: printcmd.c $(defs_h) $(gdb_s $(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \ $(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \ $(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \ - $(gdb_assert_h) + $(gdb_assert_h) $(block_h) proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(gdb_wait_h) \ $(proc_utils_h) proc-events.o: proc-events.c $(defs_h) @@ -2191,7 +2197,7 @@ stabsread.o: stabsread.c $(defs_h) $(gdb stack.o: stack.c $(defs_h) $(gdb_string_h) $(value_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) $(target_h) $(breakpoint_h) $(demangle_h) $(inferior_h) \ - $(annotate_h) $(ui_out_h) $(source_h) + $(annotate_h) $(ui_out_h) $(source_h) $(block_h) standalone.o: standalone.c $(gdb_stat_h) $(defs_h) $(symtab_h) $(frame_h) \ $(inferior_h) $(gdb_wait_h) std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \ @@ -2203,7 +2209,7 @@ symfile.o: symfile.c $(defs_h) $(symtab_ $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) $(source_h) \ - $(gdb_assert_h) $(readline_h) $(filenames_h) + $(gdb_assert_h) $(readline_h) $(filenames_h) $(block_h) symm-nat.o: symm-nat.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(target_h) $(regcache_h) $(gdb_wait_h) $(gdb_stat_h) $(gdbcore_h) \ $(gdbcore_h) @@ -2212,13 +2218,13 @@ symm-tdep.o: symm-tdep.c $(defs_h) $(fra symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ $(gdb_obstack_h) $(language_h) $(bcache_h) $(gdb_string_h) \ - $(readline_h) + $(readline_h) $(block_h) symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \ - $(cp_abi_h) $(source_h) + $(cp_abi_h) $(source_h) $(block_h) target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ $(gdb_wait_h) $(dcache_h) $(regcache_h) @@ -2238,8 +2244,8 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(cal tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ - $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) $(ax_h) \ - $(ax_gdb_h) $(readline_h) + $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) \ + $(block_h) $(ax_h) $(ax_gdb_h) $(readline_h) typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) @@ -2264,14 +2270,14 @@ valarith.o: valarith.c $(defs_h) $(value valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \ $(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \ $(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(gdb_string_h) \ - $(gdb_assert_h) + $(gdb_assert_h) $(block_h) valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \ $(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) values.o: values.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcore_h) $(command_h) $(gdbcmd_h) $(target_h) \ $(language_h) $(scm_lang_h) $(demangle_h) $(doublest_h) \ - $(gdb_assert_h) $(regcache_h) + $(gdb_assert_h) $(regcache_h) $(block_h) varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \ $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h) vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \ @@ -2296,7 +2302,7 @@ x86-64-linux-tdep.o: x86-64-linux-tdep.c $(osabi_h) x86-64-tdep.o: x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(gdbcmd_h) $(arch_utils_h) $(regcache_h) $(symfile_h) $(objfiles_h) \ - $(x86_64_tdep_h) $(dwarf2cfi_h) $(gdb_assert_h) + $(x86_64_tdep_h) $(dwarf2cfi_h) $(gdb_assert_h) $(block_h) xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \ $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) \ $(coff_rs6000_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ @@ -2512,7 +2518,7 @@ mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(environ_h) $(command_h) $(ui_out_h) $(top_h) $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-env.c mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ - $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) + $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(block_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) Index: ada-exp.y =================================================================== RCS file: /cvs/src/src/gdb/ada-exp.y,v retrieving revision 1.4 diff -u -p -r1.4 ada-exp.y --- ada-exp.y 19 Sep 2002 13:59:26 -0000 1.4 +++ ada-exp.y 19 Feb 2003 22:26:42 -0000 @@ -49,6 +49,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ #include "frame.h" +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.17 diff -u -p -r1.17 ada-lang.c --- ada-lang.c 2 Jan 2003 20:29:15 -0000 1.17 +++ ada-lang.c 19 Feb 2003 22:26:44 -0000 @@ -37,6 +37,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg #include "gdbcore.h" #include "ada-lang.h" #include "ui-out.h" +#include "block.h" struct cleanup *unresolved_names; Index: ada-lang.h =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.h,v retrieving revision 1.2 diff -u -p -r1.2 ada-lang.h --- ada-lang.h 18 Aug 2002 18:07:17 -0000 1.2 +++ ada-lang.h 19 Feb 2003 22:26:44 -0000 @@ -23,6 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridg #include "value.h" #include "gdbtypes.h" +struct block; + /* A macro to reorder the bytes of an address depending on the endiannes of the target */ #define EXTRACT_ADDRESS(x) ((void *) extract_address (&(x), sizeof (x))) Index: alpha-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/alpha-tdep.c,v retrieving revision 1.60 diff -u -p -r1.60 alpha-tdep.c --- alpha-tdep.c 31 Jan 2003 18:28:25 -0000 1.60 +++ alpha-tdep.c 19 Feb 2003 22:26:44 -0000 @@ -35,6 +35,7 @@ #include "doublest.h" #include "arch-utils.h" #include "osabi.h" +#include "block.h" #include "elf-bfd.h" Index: ax-gdb.c =================================================================== RCS file: /cvs/src/src/gdb/ax-gdb.c,v retrieving revision 1.17 diff -u -p -r1.17 ax-gdb.c --- ax-gdb.c 14 Jan 2003 00:49:03 -0000 1.17 +++ ax-gdb.c 19 Feb 2003 22:26:45 -0000 @@ -33,6 +33,7 @@ #include "ax.h" #include "ax-gdb.h" #include "gdb_string.h" +#include "block.h" /* To make sense of this file, you should read doc/agentexpr.texi. Then look at the types and enums in ax-gdb.h. For the code itself, Index: blockframe.c =================================================================== RCS file: /cvs/src/src/gdb/blockframe.c,v retrieving revision 1.62 diff -u -p -r1.62 blockframe.c --- blockframe.c 21 Jan 2003 19:43:47 -0000 1.62 +++ blockframe.c 19 Feb 2003 22:26:45 -0000 @@ -38,6 +38,7 @@ #include "dummy-frame.h" #include "command.h" #include "gdbcmd.h" +#include "block.h" /* Prototypes for exported functions. */ @@ -256,96 +257,6 @@ get_frame_function (struct frame_info *f return block_function (bl); } - -/* Return the blockvector immediately containing the innermost lexical block - containing the specified pc value and section, or 0 if there is none. - PINDEX is a pointer to the index value of the block. If PINDEX - is NULL, we don't pass this information back to the caller. */ - -struct blockvector * -blockvector_for_pc_sect (register CORE_ADDR pc, struct sec *section, - int *pindex, struct symtab *symtab) -{ - register struct block *b; - register int bot, top, half; - struct blockvector *bl; - - if (symtab == 0) /* if no symtab specified by caller */ - { - /* First search all symtabs for one whose file contains our pc */ - if ((symtab = find_pc_sect_symtab (pc, section)) == 0) - return 0; - } - - bl = BLOCKVECTOR (symtab); - b = BLOCKVECTOR_BLOCK (bl, 0); - - /* Then search that symtab for the smallest block that wins. */ - /* Use binary search to find the last block that starts before PC. */ - - bot = 0; - top = BLOCKVECTOR_NBLOCKS (bl); - - while (top - bot > 1) - { - half = (top - bot + 1) >> 1; - b = BLOCKVECTOR_BLOCK (bl, bot + half); - if (BLOCK_START (b) <= pc) - bot += half; - else - top = bot + half; - } - - /* Now search backward for a block that ends after PC. */ - - while (bot >= 0) - { - b = BLOCKVECTOR_BLOCK (bl, bot); - if (BLOCK_END (b) > pc) - { - if (pindex) - *pindex = bot; - return bl; - } - bot--; - } - return 0; -} - -/* Return the blockvector immediately containing the innermost lexical block - containing the specified pc value, or 0 if there is none. - Backward compatibility, no section. */ - -struct blockvector * -blockvector_for_pc (register CORE_ADDR pc, int *pindex) -{ - return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc), - pindex, NULL); -} - -/* Return the innermost lexical block containing the specified pc value - in the specified section, or 0 if there is none. */ - -struct block * -block_for_pc_sect (register CORE_ADDR pc, struct sec *section) -{ - register struct blockvector *bl; - int index; - - bl = blockvector_for_pc_sect (pc, section, &index, NULL); - if (bl) - return BLOCKVECTOR_BLOCK (bl, index); - return 0; -} - -/* Return the innermost lexical block containing the specified pc value, - or 0 if there is none. Backward compatibility, no section. */ - -struct block * -block_for_pc (register CORE_ADDR pc) -{ - return block_for_pc_sect (pc, find_pc_mapped_section (pc)); -} /* Return the function containing pc value PC in section SECTION. Returns 0 if function is not known. */ Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.109 diff -u -p -r1.109 breakpoint.c --- breakpoint.c 4 Feb 2003 22:49:19 -0000 1.109 +++ breakpoint.c 19 Feb 2003 22:26:46 -0000 @@ -48,6 +48,7 @@ #include "ui-out.h" #include "cli/cli-script.h" #include "gdb_assert.h" +#include "block.h" #include "gdb-events.h" Index: breakpoint.h =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.h,v retrieving revision 1.18 diff -u -p -r1.18 breakpoint.h --- breakpoint.h 4 Feb 2003 22:49:19 -0000 1.18 +++ breakpoint.h 19 Feb 2003 22:26:46 -0000 @@ -28,6 +28,7 @@ #include "gdb-events.h" struct value; +struct block; /* This is the maximum number of bytes a breakpoint instruction can take. Feel free to increase it. It's just used in a few places to size Index: buildsym.c =================================================================== RCS file: /cvs/src/src/gdb/buildsym.c,v retrieving revision 1.27 diff -u -p -r1.27 buildsym.c --- buildsym.c 14 Jan 2003 00:15:05 -0000 1.27 +++ buildsym.c 19 Feb 2003 22:26:46 -0000 @@ -43,6 +43,7 @@ #include "filenames.h" /* For DOSish file names */ #include "macrotab.h" #include "demangle.h" /* Needed by SYMBOL_INIT_DEMANGLED_NAME. */ +#include "block.h" /* Ask buildsym.h to define the vars it normally declares `extern'. */ #define EXTERN /**/ Index: buildsym.h =================================================================== RCS file: /cvs/src/src/gdb/buildsym.h,v retrieving revision 1.10 diff -u -p -r1.10 buildsym.h --- buildsym.h 9 Jan 2003 18:30:32 -0000 1.10 +++ buildsym.h 19 Feb 2003 22:26:47 -0000 @@ -34,6 +34,8 @@ normally extern, but which get defined in a single module using this technique. */ +struct block; + #ifndef EXTERN #define EXTERN extern #endif Index: c-exp.y =================================================================== RCS file: /cvs/src/src/gdb/c-exp.y,v retrieving revision 1.18 diff -u -p -r1.18 c-exp.y --- c-exp.y 31 Jan 2003 23:22:07 -0000 1.18 +++ c-exp.y 19 Feb 2003 22:26:47 -0000 @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ #include "charset.h" +#include "block.h" /* Flag indicating we're dealing with HP-compiled objects */ extern int hp_som_som_object_present; Index: coffread.c =================================================================== RCS file: /cvs/src/src/gdb/coffread.c,v retrieving revision 1.33 diff -u -p -r1.33 coffread.c --- coffread.c 4 Feb 2003 18:07:00 -0000 1.33 +++ coffread.c 19 Feb 2003 22:26:47 -0000 @@ -44,6 +44,7 @@ #include "complaints.h" #include "target.h" #include "gdb_assert.h" +#include "block.h" extern void _initialize_coffread (void); Index: expprint.c =================================================================== RCS file: /cvs/src/src/gdb/expprint.c,v retrieving revision 1.13 diff -u -p -r1.13 expprint.c --- expprint.c 14 Jan 2003 00:49:03 -0000 1.13 +++ expprint.c 19 Feb 2003 22:26:47 -0000 @@ -30,6 +30,7 @@ #include "frame.h" /* For frame_map_regnum_to_name. */ #include "target.h" #include "gdb_string.h" +#include "block.h" #ifdef HAVE_CTYPE_H #include Index: f-exp.y =================================================================== RCS file: /cvs/src/src/gdb/f-exp.y,v retrieving revision 1.10 diff -u -p -r1.10 f-exp.y --- f-exp.y 31 Jan 2003 23:22:07 -0000 1.10 +++ f-exp.y 19 Feb 2003 22:26:48 -0000 @@ -53,6 +53,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" #include /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), Index: f-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/f-valprint.c,v retrieving revision 1.11 diff -u -p -r1.11 f-valprint.c --- f-valprint.c 17 Jan 2003 19:12:18 -0000 1.11 +++ f-valprint.c 19 Feb 2003 22:26:48 -0000 @@ -33,6 +33,7 @@ #include "frame.h" #include "gdbcore.h" #include "command.h" +#include "block.h" #if 0 static int there_is_a_visible_common_named (char *); Index: findvar.c =================================================================== RCS file: /cvs/src/src/gdb/findvar.c,v retrieving revision 1.45 diff -u -p -r1.45 findvar.c --- findvar.c 4 Feb 2003 22:04:08 -0000 1.45 +++ findvar.c 19 Feb 2003 22:26:48 -0000 @@ -35,6 +35,7 @@ #include "symfile.h" /* for overlay functions */ #include "regcache.h" #include "builtin-regs.h" +#include "block.h" /* Basic byte-swapping routines. GDB has needed these for a long time... All extract a target-format integer at ADDR which is LEN bytes long. */ Index: frame.h =================================================================== RCS file: /cvs/src/src/gdb/frame.h,v retrieving revision 1.66 diff -u -p -r1.66 frame.h --- frame.h 2 Feb 2003 20:31:43 -0000 1.66 +++ frame.h 19 Feb 2003 22:26:48 -0000 @@ -25,6 +25,7 @@ struct symtab_and_line; struct frame_unwind; +struct block; /* The traditional frame unwinder. */ extern const struct frame_unwind *trad_frame_unwind; @@ -505,10 +506,6 @@ extern struct symbol *get_frame_function extern CORE_ADDR frame_address_in_block (struct frame_info *); extern CORE_ADDR get_pc_function_start (CORE_ADDR); - -extern struct block *block_for_pc (CORE_ADDR); - -extern struct block *block_for_pc_sect (CORE_ADDR, asection *); extern int frameless_look_for_prologue (struct frame_info *); Index: infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.72 diff -u -p -r1.72 infcmd.c --- infcmd.c 1 Feb 2003 17:28:40 -0000 1.72 +++ infcmd.c 19 Feb 2003 22:26:49 -0000 @@ -42,6 +42,7 @@ #include "parser-defs.h" #include "regcache.h" #include "reggroups.h" +#include "block.h" #include /* Functions exported for general use, in inferior.h: */ Index: jv-exp.y =================================================================== RCS file: /cvs/src/src/gdb/jv-exp.y,v retrieving revision 1.12 diff -u -p -r1.12 jv-exp.y --- jv-exp.y 11 Oct 2002 14:02:37 -0000 1.12 +++ jv-exp.y 19 Feb 2003 22:26:49 -0000 @@ -48,6 +48,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple Index: jv-lang.c =================================================================== RCS file: /cvs/src/src/gdb/jv-lang.c,v retrieving revision 1.13 diff -u -p -r1.13 jv-lang.c --- jv-lang.c 4 Feb 2003 21:55:25 -0000 1.13 +++ jv-lang.c 19 Feb 2003 22:26:49 -0000 @@ -33,6 +33,7 @@ #include "c-lang.h" #include "jv-lang.h" #include "gdbcore.h" +#include "block.h" #include struct type *java_int_type; Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.40 diff -u -p -r1.40 linespec.c --- linespec.c 7 Feb 2003 00:27:30 -0000 1.40 +++ linespec.c 19 Feb 2003 22:26:49 -0000 @@ -32,6 +32,7 @@ #include "completer.h" #include "cp-abi.h" #include "parser-defs.h" +#include "block.h" /* We share this one with symtab.c, but it is not exported widely. */ Index: m2-exp.y =================================================================== RCS file: /cvs/src/src/gdb/m2-exp.y,v retrieving revision 1.7 diff -u -p -r1.7 m2-exp.y --- m2-exp.y 6 Nov 2002 22:48:25 -0000 1.7 +++ m2-exp.y 19 Feb 2003 22:26:49 -0000 @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple Index: mdebugread.c =================================================================== RCS file: /cvs/src/src/gdb/mdebugread.c,v retrieving revision 1.40 diff -u -p -r1.40 mdebugread.c --- mdebugread.c 4 Feb 2003 18:07:01 -0000 1.40 +++ mdebugread.c 19 Feb 2003 22:26:51 -0000 @@ -53,6 +53,7 @@ #include "complaints.h" #include "demangle.h" #include "gdb_assert.h" +#include "block.h" /* These are needed if the tm.h file does not contain the necessary mips specific definitions. */ Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.161 diff -u -p -r1.161 mips-tdep.c --- mips-tdep.c 28 Jan 2003 16:31:11 -0000 1.161 +++ mips-tdep.c 19 Feb 2003 22:26:54 -0000 @@ -40,6 +40,7 @@ #include "regcache.h" #include "osabi.h" #include "mips-tdep.h" +#include "block.h" #include "opcode/mips.h" #include "elf/mips.h" Index: nlmread.c =================================================================== RCS file: /cvs/src/src/gdb/nlmread.c,v retrieving revision 1.9 diff -u -p -r1.9 nlmread.c --- nlmread.c 2 Dec 2001 22:38:23 -0000 1.9 +++ nlmread.c 19 Feb 2003 22:26:54 -0000 @@ -27,6 +27,7 @@ #include "objfiles.h" #include "buildsym.h" #include "stabsread.h" +#include "block.h" extern void _initialize_nlmread (void); Index: objc-exp.y =================================================================== RCS file: /cvs/src/src/gdb/objc-exp.y,v retrieving revision 1.9 diff -u -p -r1.9 objc-exp.y --- objc-exp.y 31 Jan 2003 23:22:07 -0000 1.9 +++ objc-exp.y 19 Feb 2003 22:26:55 -0000 @@ -52,6 +52,7 @@ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols. */ #include "top.h" #include "completer.h" /* For skip_quoted(). */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have Index: objc-lang.c =================================================================== RCS file: /cvs/src/src/gdb/objc-lang.c,v retrieving revision 1.9 diff -u -p -r1.9 objc-lang.c --- objc-lang.c 24 Dec 2002 03:42:36 -0000 1.9 +++ objc-lang.c 19 Feb 2003 22:26:55 -0000 @@ -41,6 +41,7 @@ #include "frame.h" #include "gdb_regex.h" #include "regcache.h" +#include "block.h" #include Index: objc-lang.h =================================================================== RCS file: /cvs/src/src/gdb/objc-lang.h,v retrieving revision 1.5 diff -u -p -r1.5 objc-lang.h --- objc-lang.h 3 Dec 2002 03:52:37 -0000 1.5 +++ objc-lang.h 19 Feb 2003 22:26:55 -0000 @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ struct value; +struct block; extern int objc_parse (void); /* Defined in c-exp.y */ Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.27 diff -u -p -r1.27 objfiles.c --- objfiles.c 4 Feb 2003 21:55:26 -0000 1.27 +++ objfiles.c 19 Feb 2003 22:26:56 -0000 @@ -42,6 +42,7 @@ #include "hashtab.h" #include "breakpoint.h" +#include "block.h" /* Prototypes for local functions */ Index: p-exp.y =================================================================== RCS file: /cvs/src/src/gdb/p-exp.y,v retrieving revision 1.21 diff -u -p -r1.21 p-exp.y --- p-exp.y 9 Dec 2002 20:48:07 -0000 1.21 +++ p-exp.y 19 Feb 2003 22:26:58 -0000 @@ -56,6 +56,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple Index: parse.c =================================================================== RCS file: /cvs/src/src/gdb/parse.c,v retrieving revision 1.32 diff -u -p -r1.32 parse.c --- parse.c 19 Jan 2003 04:06:46 -0000 1.32 +++ parse.c 19 Feb 2003 22:26:58 -0000 @@ -48,6 +48,7 @@ with "gdbarch.h" when appropriate. */ #include "doublest.h" #include "gdb_assert.h" +#include "block.h" /* Symbols which architectures can redefine. */ Index: parser-defs.h =================================================================== RCS file: /cvs/src/src/gdb/parser-defs.h,v retrieving revision 1.15 diff -u -p -r1.15 parser-defs.h --- parser-defs.h 19 Nov 2002 03:15:01 -0000 1.15 +++ parser-defs.h 19 Feb 2003 22:26:58 -0000 @@ -28,6 +28,8 @@ #include "doublest.h" +struct block; + extern struct expression *expout; extern int expout_size; extern int expout_ptr; Index: printcmd.c =================================================================== RCS file: /cvs/src/src/gdb/printcmd.c,v retrieving revision 1.52 diff -u -p -r1.52 printcmd.c --- printcmd.c 14 Feb 2003 13:58:06 -0000 1.52 +++ printcmd.c 19 Feb 2003 22:27:00 -0000 @@ -41,6 +41,7 @@ #include "completer.h" /* for completion functions */ #include "ui-out.h" #include "gdb_assert.h" +#include "block.h" extern int asm_demangle; /* Whether to demangle syms in asm printouts */ extern int addressprint; /* Whether to print hex addresses in HLL " */ Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.65 diff -u -p -r1.65 stack.c --- stack.c 2 Feb 2003 18:30:56 -0000 1.65 +++ stack.c 19 Feb 2003 22:27:01 -0000 @@ -39,6 +39,7 @@ #include "inferior.h" #include "annotate.h" #include "ui-out.h" +#include "block.h" /* Prototypes for exported functions. */ Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.87 diff -u -p -r1.87 symfile.c --- symfile.c 4 Feb 2003 18:07:01 -0000 1.87 +++ symfile.c 19 Feb 2003 22:27:03 -0000 @@ -47,6 +47,7 @@ #include "hashtab.h" #include #include "gdb_assert.h" +#include "block.h" #include #include Index: symfile.h =================================================================== RCS file: /cvs/src/src/gdb/symfile.h,v retrieving revision 1.18 diff -u -p -r1.18 symfile.h --- symfile.h 31 Jan 2003 19:22:18 -0000 1.18 +++ symfile.h 19 Feb 2003 22:27:03 -0000 @@ -28,6 +28,7 @@ /* Opaque declarations. */ struct obstack; +struct block; /* Partial symbols are stored in the psymbol_cache and pointers to them are kept in a dynamically grown array that is obtained from malloc and Index: symmisc.c =================================================================== RCS file: /cvs/src/src/gdb/symmisc.c,v retrieving revision 1.15 diff -u -p -r1.15 symmisc.c --- symmisc.c 14 Feb 2003 01:13:45 -0000 1.15 +++ symmisc.c 19 Feb 2003 22:27:03 -0000 @@ -32,6 +32,7 @@ #include "gdb_obstack.h" #include "language.h" #include "bcache.h" +#include "block.h" #include "gdb_string.h" #include Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.87 diff -u -p -r1.87 symtab.c --- symtab.c 4 Feb 2003 18:07:01 -0000 1.87 +++ symtab.c 19 Feb 2003 22:27:04 -0000 @@ -44,6 +44,7 @@ #include "hashtab.h" #include "gdb_obstack.h" +#include "block.h" #include #include @@ -1786,18 +1787,6 @@ find_active_alias (struct symbol *sym, C } -/* Return the symbol for the function which contains a specified - lexical block, described by a struct block BL. */ - -struct symbol * -block_function (struct block *bl) -{ - while (BLOCK_FUNCTION (bl) == 0 && BLOCK_SUPERBLOCK (bl) != 0) - bl = BLOCK_SUPERBLOCK (bl); - - return BLOCK_FUNCTION (bl); -} - /* Find the symtab associated with PC and SECTION. Look through the psymtabs and read in another symtab if necessary. */ @@ -3280,19 +3269,6 @@ rbreak_command (char *regexp, int from_t } do_cleanups (old_chain); -} - - -/* Return Nonzero if block a is lexically nested within block b, - or if a and b have the same pc range. - Return zero otherwise. */ -int -contained_in (struct block *a, struct block *b) -{ - if (!a || !b) - return 0; - return BLOCK_START (a) >= BLOCK_START (b) - && BLOCK_END (a) <= BLOCK_END (b); } Index: symtab.h =================================================================== RCS file: /cvs/src/src/gdb/symtab.h,v retrieving revision 1.58 diff -u -p -r1.58 symtab.h --- symtab.h 18 Feb 2003 22:14:26 -0000 1.58 +++ symtab.h 19 Feb 2003 22:27:05 -0000 @@ -25,8 +25,11 @@ #define SYMTAB_H 1 /* Opaque declarations. */ + struct obstack; struct objfile; +struct block; +struct blockvector; /* Don't do this; it means that if some .o's are compiled with GNU C and some are not (easy to do accidentally the way we configure @@ -287,148 +290,7 @@ struct minimal_symbol #define MSYMBOL_INFO(msymbol) (msymbol)->info #define MSYMBOL_TYPE(msymbol) (msymbol)->type - - - -/* All of the name-scope contours of the program - are represented by `struct block' objects. - All of these objects are pointed to by the blockvector. - - Each block represents one name scope. - Each lexical context has its own block. - - The blockvector begins with some special blocks. - The GLOBAL_BLOCK contains all the symbols defined in this compilation - whose scope is the entire program linked together. - The STATIC_BLOCK contains all the symbols whose scope is the - entire compilation excluding other separate compilations. - Blocks starting with the FIRST_LOCAL_BLOCK are not special. - - Each block records a range of core addresses for the code that - is in the scope of the block. The STATIC_BLOCK and GLOBAL_BLOCK - give, for the range of code, the entire range of code produced - by the compilation that the symbol segment belongs to. - - The blocks appear in the blockvector - in order of increasing starting-address, - and, within that, in order of decreasing ending-address. - - This implies that within the body of one function - the blocks appear in the order of a depth-first tree walk. */ - -struct blockvector -{ - /* Number of blocks in the list. */ - int nblocks; - /* The blocks themselves. */ - struct block *block[1]; -}; - -#define BLOCKVECTOR_NBLOCKS(blocklist) (blocklist)->nblocks -#define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n] - -/* Special block numbers */ - -#define GLOBAL_BLOCK 0 -#define STATIC_BLOCK 1 -#define FIRST_LOCAL_BLOCK 2 - -struct block -{ - - /* Addresses in the executable code that are in this block. */ - - CORE_ADDR startaddr; - CORE_ADDR endaddr; - - /* The symbol that names this block, if the block is the body of a - function; otherwise, zero. */ - - struct symbol *function; - - /* The `struct block' for the containing block, or 0 if none. - - The superblock of a top-level local block (i.e. a function in the - case of C) is the STATIC_BLOCK. The superblock of the - STATIC_BLOCK is the GLOBAL_BLOCK. */ - - struct block *superblock; - /* Version of GCC used to compile the function corresponding - to this block, or 0 if not compiled with GCC. When possible, - GCC should be compatible with the native compiler, or if that - is not feasible, the differences should be fixed during symbol - reading. As of 16 Apr 93, this flag is never used to distinguish - between gcc2 and the native compiler. - - If there is no function corresponding to this block, this meaning - of this flag is undefined. */ - - unsigned char gcc_compile_flag; - - /* The symbols for this block are either in a simple linear list or - in a simple hashtable. Blocks which correspond to a function - (which have a list of symbols corresponding to arguments) use - a linear list, as do some older symbol readers (currently only - mdebugread and dstread). Other blocks are hashed. - - The hashtable uses the same hash function as the minsym hashtables, - found in minsyms.c:minsym_hash_iw. Symbols are hashed based on - their demangled name if appropriate, and on their name otherwise. - The hash function ignores space, and stops at the beginning of the - argument list if any. - - The table is laid out in NSYMS/5 buckets and symbols are chained via - their hash_next field. */ - - /* If this is really a hashtable of the symbols, this flag is 1. */ - - unsigned char hashtable; - - /* Number of local symbols. */ - - int nsyms; - - /* The symbols. If some of them are arguments, then they must be - in the order in which we would like to print them. */ - - struct symbol *sym[1]; -}; - -#define BLOCK_START(bl) (bl)->startaddr -#define BLOCK_END(bl) (bl)->endaddr -#define BLOCK_FUNCTION(bl) (bl)->function -#define BLOCK_SUPERBLOCK(bl) (bl)->superblock -#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag -#define BLOCK_HASHTABLE(bl) (bl)->hashtable - -/* For blocks without a hashtable (BLOCK_HASHTABLE (bl) == 0) only. */ -#define BLOCK_NSYMS(bl) (bl)->nsyms -#define BLOCK_SYM(bl, n) (bl)->sym[n] - -/* For blocks with a hashtable, but these are valid for non-hashed blocks as - well - each symbol will appear to be one bucket by itself. */ -#define BLOCK_BUCKETS(bl) (bl)->nsyms -#define BLOCK_BUCKET(bl, n) (bl)->sym[n] - -/* Macro used to set the size of a hashtable for N symbols. */ -#define BLOCK_HASHTABLE_SIZE(n) ((n)/5 + 1) - -/* Macro to loop through all symbols in a block BL, in no particular order. - i counts which bucket we are in, and sym points to the current symbol. */ - -#define ALL_BLOCK_SYMBOLS(bl, i, sym) \ - for ((i) = 0; (i) < BLOCK_BUCKETS ((bl)); (i)++) \ - for ((sym) = BLOCK_BUCKET ((bl), (i)); (sym); \ - (sym) = (sym)->hash_next) - -/* Nonzero if symbols of block BL should be sorted alphabetically. - Don't sort a block which corresponds to a function. If we did the - sorting would have to preserve the order of the symbols for the - arguments. Also don't sort any block that we chose to hash. */ - -#define BLOCK_SHOULD_SORT(bl) (! BLOCK_HASHTABLE (bl) \ - && BLOCK_FUNCTION (bl) == NULL) /* Represent one symbol name; a variable, constant, function or typedef. */ @@ -1054,10 +916,6 @@ extern struct type *lookup_union (char * extern struct type *lookup_enum (char *, struct block *); -/* lookup the function corresponding to the block */ - -extern struct symbol *block_function (struct block *); - /* from blockframe.c: */ /* lookup the function symbol corresponding to the address */ @@ -1112,8 +970,6 @@ extern struct partial_symbol *find_pc_se extern int find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *); -extern int contained_in (struct block *, struct block *); - extern void reread_symbols (void); extern struct type *lookup_transparent_type (const char *); @@ -1316,13 +1172,6 @@ extern struct symtab *find_line_symtab ( extern struct symtab_and_line find_function_start_sal (struct symbol *sym, int); - -/* blockframe.c */ - -extern struct blockvector *blockvector_for_pc (CORE_ADDR, int *); - -extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, asection *, - int *, struct symtab *); /* symfile.c */ Index: tracepoint.c =================================================================== RCS file: /cvs/src/src/gdb/tracepoint.c,v retrieving revision 1.46 diff -u -p -r1.46 tracepoint.c --- tracepoint.c 28 Dec 2002 23:22:21 -0000 1.46 +++ tracepoint.c 19 Feb 2003 22:27:06 -0000 @@ -37,6 +37,7 @@ #include "regcache.h" #include "completer.h" #include "gdb-events.h" +#include "block.h" #include "ax.h" #include "ax-gdb.h" Index: valops.c =================================================================== RCS file: /cvs/src/src/gdb/valops.c,v retrieving revision 1.89 diff -u -p -r1.89 valops.c --- valops.c 30 Jan 2003 16:44:20 -0000 1.89 +++ valops.c 19 Feb 2003 22:27:08 -0000 @@ -33,6 +33,7 @@ #include "gdbcmd.h" #include "regcache.h" #include "cp-abi.h" +#include "block.h" #include #include "gdb_string.h" Index: value.h =================================================================== RCS file: /cvs/src/src/gdb/value.h,v retrieving revision 1.41 diff -u -p -r1.41 value.h --- value.h 19 Jan 2003 04:06:46 -0000 1.41 +++ value.h 19 Feb 2003 22:27:08 -0000 @@ -24,6 +24,7 @@ #define VALUE_H 1 struct regcache; +struct block; #include "doublest.h" Index: values.c =================================================================== RCS file: /cvs/src/src/gdb/values.c,v retrieving revision 1.46 diff -u -p -r1.46 values.c --- values.c 7 Feb 2003 00:27:30 -0000 1.46 +++ values.c 19 Feb 2003 22:27:09 -0000 @@ -36,6 +36,7 @@ #include "doublest.h" #include "gdb_assert.h" #include "regcache.h" +#include "block.h" /* Prototypes for exported functions. */ Index: x86-64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v retrieving revision 1.48 diff -u -p -r1.48 x86-64-tdep.c --- x86-64-tdep.c 11 Feb 2003 23:09:59 -0000 1.48 +++ x86-64-tdep.c 19 Feb 2003 22:27:09 -0000 @@ -31,6 +31,7 @@ #include "x86-64-tdep.h" #include "dwarf2cfi.h" #include "gdb_assert.h" +#include "block.h" /* Register numbers of various important registers. */ #define RAX_REGNUM 0 Index: mi/mi-cmd-stack.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-stack.c,v retrieving revision 1.13 diff -u -p -r1.13 mi-cmd-stack.c --- mi/mi-cmd-stack.c 29 Nov 2002 19:15:16 -0000 1.13 +++ mi/mi-cmd-stack.c 19 Feb 2003 22:27:10 -0000 @@ -26,6 +26,7 @@ #include "mi-cmds.h" #include "ui-out.h" #include "symtab.h" +#include "block.h" /* FIXME: these should go in some .h file but stack.c doesn't have a corresponding .h file. These wrappers will be obsolete anyway, once