aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-01-08 17:55:25 +0000
committerJeff Law <law@redhat.com>1996-01-08 17:55:25 +0000
commit436d4143274d6bb3c32632f7ae1bd82cda5128b5 (patch)
tree1b03454d0f21a99f7d5f601c3f7d023edfea7e8f /gdb/buildsym.c
parent01082eaf1926a56afc7b4cb51a25d3560ee31f5b (diff)
downloadfsf-binutils-gdb-436d4143274d6bb3c32632f7ae1bd82cda5128b5.zip
fsf-binutils-gdb-436d4143274d6bb3c32632f7ae1bd82cda5128b5.tar.gz
fsf-binutils-gdb-436d4143274d6bb3c32632f7ae1bd82cda5128b5.tar.bz2
* buildsym.c (end_symtab): Remove sort_pending and sort_linevec
arguments. Sorting is now dependent on OBJF_REORDERED. All callers/references changed. * dbxread.c (read_ofile_symtab): Correctly determine value for last_source_start_addr for reordered executables. (process_one_symbol): Handle N_FUN with no name as an end of function marker. * partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE is the high text address for a psymtab. (case N_SO): Likewise. (case N_FUN): Handle N_FUN with no name as an end of function marker. * minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols at the same address rather than a random subset of them. * coffread.c (coff_symfile_init): Set OBJF_REORDERED. * elfread.c (elf_symfile_init): Similarly. * somread.c (som_symfile_init): Similarly. * xcoffread.c (xcoff_symfile_init): Similarly. Support for debugging reordered executables. Remaining mentor vm changes.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index c9c30b0..5a5847a 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1,5 +1,5 @@
/* 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.
@@ -737,10 +737,8 @@ start_symtab (name, dirname, start_addr)
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;
{
@@ -774,14 +772,12 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, 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
{
@@ -865,12 +861,11 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile, section)
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);