/* Support routines for building symbol tables in GDB's internal format.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1995
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1995, 1996
Free Software Foundation, Inc.
This file is part of GDB.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This module provides subroutines used for creating and adding to
the symbol table. These routines are called from various symbol-
#include "objfiles.h"
#include "gdbtypes.h"
#include "complaints.h"
-#include <string.h>
+#include "gdb_string.h"
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN /**/
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
+ case LOC_UNRESOLVED:
case LOC_OPTIMIZED_OUT:
default:
break;
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
+ case LOC_UNRESOLVED:
case LOC_OPTIMIZED_OUT:
default:
break;
static int
compare_line_numbers (ln1p, ln2p)
- const PTR ln1p;
- const PTR ln2p;
+ const void *ln1p;
+ const void *ln2p;
{
struct linetable_entry *ln1 = (struct linetable_entry *) ln1p;
struct linetable_entry *ln2 = (struct linetable_entry *) ln2p;
because then gdb will never know about this empty file (FIXME). */
struct symtab *
-end_symtab (end_addr, sort_pending, sort_linevec, objfile, section)
+end_symtab (end_addr, objfile, section)
CORE_ADDR end_addr;
- int sort_pending;
- int sort_linevec;
struct objfile *objfile;
int section;
{
}
}
- /* It is unfortunate that in xcoff, pending blocks might not be ordered
- in this stage. Especially, blocks for static functions will show up at
- the end. We need to sort them, so tools like `find_pc_function' and
- `find_pc_block' can work reliably. */
-
- if (sort_pending && pending_blocks)
+ /* Reordered executables may have out of order pending blocks; if
+ OBJF_REORDERED is true, then sort the pending blocks. */
+ if ((objfile->flags & OBJF_REORDERED) && pending_blocks)
{
- /* FIXME! Remove this horrid bubble sort and use qsort!!! */
+ /* FIXME! Remove this horrid bubble sort and use qsort!!!
+ It'd be a whole lot easier if they weren't in a linked list!!! */
int swapped;
do
{
subfile->line_vector = (struct linetable *)
xrealloc ((char *) subfile->line_vector, linetablesize);
#endif
- /* If sort_linevec is false, we might want just check to make
- sure they are sorted and complain() if not, as a way of
- tracking down compilers/symbol readers which don't get
- them sorted right. */
- if (sort_linevec)
+ /* Like the pending blocks, the line table may be scrambled
+ in reordered executables. Sort it if OBJF_REORDERED is
+ true. */
+ if (objfile->flags & OBJF_REORDERED)
qsort (subfile->line_vector->item,
subfile->line_vector->nitems,
sizeof (struct linetable_entry), compare_line_numbers);