aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-04 15:11:19 +0000
committerTom Tromey <tromey@redhat.com>2011-04-04 15:11:19 +0000
commit30cc903e7cd4678ec556d5386be55c3c726b6a27 (patch)
tree0043b2abe6ef2f26dff87b8be35be09b8f9ca025 /gdb/symmisc.c
parent0c2e60193cf41ec57f62a5640ed67e4291e8f815 (diff)
downloadgdb-30cc903e7cd4678ec556d5386be55c3c726b6a27.zip
gdb-30cc903e7cd4678ec556d5386be55c3c726b6a27.tar.gz
gdb-30cc903e7cd4678ec556d5386be55c3c726b6a27.tar.bz2
* mdebugread.c (psymtab_to_symtab_1): Copy linetable to obstack.
(new_symtab): Don't set `free_code' on symtab. (new_linetable): Properly handle size==0. * symtab.h (struct symtab) <free_code, free_func>: Remove. * symmisc.c (free_symtab): Don't free the linetable. Don't call free_func. * jv-lang.c (struct jv_per_objfile_data): New. (jv_per_objfile_free): Free the data. (get_dynamics_objfile): Allocate a jv_per_objfile_data. (get_java_class_symtab): Set the `dict' field on the jv_per_objfile_data. (free_class_block): Remove. * buildsym.c (end_symtab): Don't set `free_code' or `free_func' on the symtab.
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 79ff355..5120162 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -79,37 +79,11 @@ struct print_symbol_args
static int print_symbol (void *);
-/* Free all the storage associated with the struct symtab <- S.
- Note that some symtabs have contents that all live inside one big block of
- memory, and some share the contents of another symbol table and so you
- should not free the contents on their behalf (except sometimes the
- linetable, which maybe per symtab even when the rest is not).
- It is s->free_code that says which alternative to use. */
+/* Free all the storage associated with the struct symtab <- S. */
void
free_symtab (struct symtab *s)
{
- switch (s->free_code)
- {
- case free_nothing:
- /* All the contents are part of a big block of memory (an obstack),
- and some other symtab is in charge of freeing that block.
- Therefore, do nothing. */
- break;
-
- case free_linetable:
- /* Everything will be freed either by our `free_func'
- or by some other symtab, except for our linetable.
- Free that now. */
- if (LINETABLE (s))
- xfree (LINETABLE (s));
- break;
- }
-
- /* If there is a single block of memory to free, free it. */
- if (s->free_func != NULL)
- s->free_func (s);
-
/* Free source-related stuff. */
if (s->line_charpos != NULL)
xfree (s->line_charpos);