aboutsummaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-03-29 22:25:59 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-03-29 22:25:59 +0000
commite5c007603f1d64f2f5722cb6f79227b5fd0f9350 (patch)
treebd7dc667e50ce5cef59350c94fa142ac06f42c5b /gdb/xcoffread.c
parentad3768932d9bd82936e7099388ba390b029d92a3 (diff)
downloadgdb-e5c007603f1d64f2f5722cb6f79227b5fd0f9350.zip
gdb-e5c007603f1d64f2f5722cb6f79227b5fd0f9350.tar.gz
gdb-e5c007603f1d64f2f5722cb6f79227b5fd0f9350.tar.bz2
* xcoffread.c (sort_syms, compare_symbols): Remove.
(xcoff_symfile_read): Use sort_all_symtab_syms from symfile.c not our own sort_syms (it is identical).
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c60
1 files changed, 1 insertions, 59 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 5336ec8..6299cb8 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -215,64 +215,6 @@ read_xcoff_symtab PARAMS ((struct objfile *, int));
static void
add_stab_to_list PARAMS ((char *, struct pending_stabs **));
-static void
-sort_syms PARAMS ((void));
-
-static int
-compare_symbols PARAMS ((const void *, const void *));
-
-/* Call sort_syms to sort alphabetically
- the symbols of each block of each symtab. */
-
-static int
-compare_symbols (s1p, s2p)
- const PTR s1p;
- const PTR s2p;
-{
- /* Names that are less should come first. */
- register struct symbol **s1 = (struct symbol **) s1p;
- register struct symbol **s2 = (struct symbol **) s2p;
- register int namediff = STRCMP (SYMBOL_NAME (*s1), SYMBOL_NAME (*s2));
- if (namediff != 0)
- return namediff;
-
- /* For symbols of the same name, registers should come first. */
- return ((SYMBOL_CLASS (*s2) == LOC_REGISTER)
- - (SYMBOL_CLASS (*s1) == LOC_REGISTER));
-}
-
-
-/* Sort a vector of symbols by their value. */
-
-static void
-sort_syms ()
-{
- register struct symtab *s;
- register struct objfile *objfile;
- register int i, nbl;
- register struct blockvector *bv;
- register struct block *b;
-
- for (objfile = object_files; objfile != NULL; objfile = objfile -> next)
- {
- for (s = objfile -> symtabs; s != NULL; s = s -> next)
- {
- bv = BLOCKVECTOR (s);
- nbl = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < nbl; i++)
- {
- b = BLOCKVECTOR_BLOCK (bv, i);
- if (BLOCK_SHOULD_SORT (b))
- {
- qsort (&BLOCK_SYM (b, 0), BLOCK_NSYMS (b),
- sizeof (struct symbol *), compare_symbols);
- }
- }
- }
- }
-}
-
-
/* add a given stab string into given stab vector. */
static void
@@ -2350,7 +2292,7 @@ xcoff_symfile_read (objfile, section_offset, mainline)
free_debugsection ();
/* Sort symbols alphabetically within each block. */
- sort_syms ();
+ sort_all_symtab_syms ();
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */