aboutsummaryrefslogtreecommitdiff
path: root/gdb/mdebugread.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/mdebugread.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/mdebugread.c')
-rw-r--r--gdb/mdebugread.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index e224f19..ae77ebd 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -4204,7 +4204,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
{
/* This symbol table contains ordinary ecoff entries. */
- int maxlines;
+ int maxlines, size;
EXTR *ext_ptr;
if (fh == 0)
@@ -4311,7 +4311,14 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
}
}
- LINETABLE (st) = lines;
+ size = lines->nitems;
+ if (size > 1)
+ --size;
+ LINETABLE (st) = obstack_copy (&current_objfile->objfile_obstack,
+ lines,
+ (sizeof (struct linetable)
+ + size * sizeof (lines->item)));
+ xfree (lines);
/* .. and our share of externals.
XXX use the global list to speed up things here. How?
@@ -4763,7 +4770,6 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)) =
BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
- s->free_code = free_linetable;
s->debugformat = "ECOFF";
return (s);
}
@@ -4803,7 +4809,9 @@ new_linetable (int size)
{
struct linetable *l;
- size = (size - 1) * sizeof (l->item) + sizeof (struct linetable);
+ if (size > 1)
+ --size;
+ size = size * sizeof (l->item) + sizeof (struct linetable);
l = (struct linetable *) xmalloc (size);
l->nitems = 0;
return l;