diff options
author | Tom Tromey <tromey@redhat.com> | 2010-09-14 22:50:30 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-09-14 22:50:30 +0000 |
commit | 923c6a3dd16a18e87efab5731053fbf31269b505 (patch) | |
tree | c90725a96c3a9324e30581221a7f3ceb1f1c85e6 /gdb/psymtab.c | |
parent | 36171d64bf8c2abf7951c98d655f4c5695b024f1 (diff) | |
download | gdb-923c6a3dd16a18e87efab5731053fbf31269b505.zip gdb-923c6a3dd16a18e87efab5731053fbf31269b505.tar.gz gdb-923c6a3dd16a18e87efab5731053fbf31269b505.tar.bz2 |
* psympriv.h (add_psymbol_to_list, init_psymbol_list)
(start_psymtab_common, allocate_psymtab, discard_psymtab):
Declare.
* symfile.h (extend_psymbol_list): Remove.
(add_psymbol_to_list, init_psymbol_list, start_psymtab_common)
(allocate_psymtab, discard_psymtab): Move to psympriv.h.
* psymtab.c (extend_psymbol_list): Move earlier. Now static.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 2f1bfc6..aa6dc17 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1406,6 +1406,35 @@ add_psymbol_to_bcache (char *name, int namelength, int copy_name, added); } +/* Increase the space allocated for LISTP, which is probably + global_psymbols or static_psymbols. This space will eventually + be freed in free_objfile(). */ + +static void +extend_psymbol_list (struct psymbol_allocation_list *listp, + struct objfile *objfile) +{ + int new_size; + + if (listp->size == 0) + { + new_size = 255; + listp->list = (struct partial_symbol **) + xmalloc (new_size * sizeof (struct partial_symbol *)); + } + else + { + new_size = listp->size * 2; + listp->list = (struct partial_symbol **) + xrealloc ((char *) listp->list, + new_size * sizeof (struct partial_symbol *)); + } + /* Next assumes we only went one over. Should be good if + program works correctly */ + listp->next = listp->list + listp->size; + listp->size = new_size; +} + /* Helper function, adds partial symbol to the given partial symbol list. */ @@ -1557,35 +1586,6 @@ discard_psymtab (struct partial_symtab *pst) pst->objfile->free_psymtabs = pst; } -/* Increase the space allocated for LISTP, which is probably - global_psymbols or static_psymbols. This space will eventually - be freed in free_objfile(). */ - -void -extend_psymbol_list (struct psymbol_allocation_list *listp, - struct objfile *objfile) -{ - int new_size; - - if (listp->size == 0) - { - new_size = 255; - listp->list = (struct partial_symbol **) - xmalloc (new_size * sizeof (struct partial_symbol *)); - } - else - { - new_size = listp->size * 2; - listp->list = (struct partial_symbol **) - xrealloc ((char *) listp->list, - new_size * sizeof (struct partial_symbol *)); - } - /* Next assumes we only went one over. Should be good if - program works correctly */ - listp->next = listp->list + listp->size; - listp->size = new_size; -} - void |