aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-01-24 21:10:55 +0000
committerIan Lance Taylor <ian@airs.com>1996-01-24 21:10:55 +0000
commit76e45938c3dbf2a25eb273bfcd3aa4961585dd5e (patch)
treeda030b5d4faecd6c7320064fc971ab6d31e1f7bc
parent397a4fa366643d3813beac4720a5f5552261bdba (diff)
downloadgdb-76e45938c3dbf2a25eb273bfcd3aa4961585dd5e.zip
gdb-76e45938c3dbf2a25eb273bfcd3aa4961585dd5e.tar.gz
gdb-76e45938c3dbf2a25eb273bfcd3aa4961585dd5e.tar.bz2
* ieee.c (ieee_define_named_type): When creating a tag for an
anonymous struct, copy the name into memory. (ieee_tag_type): Likewise. * debug.c (debug_write_type): Only check and set id field for an unnamed object. (debug_write_class_type): Likewise.
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/debug.c20
-rw-r--r--binutils/ieee.c4
3 files changed, 24 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 2864859..7529649 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,12 @@
Wed Jan 24 12:06:05 1996 Ian Lance Taylor <ian@cygnus.com>
+ * ieee.c (ieee_define_named_type): When creating a tag for an
+ anonymous struct, copy the name into memory.
+ (ieee_tag_type): Likewise.
+ * debug.c (debug_write_type): Only check and set id field for an
+ unnamed object.
+ (debug_write_class_type): Likewise.
+
* ieee.c: Various changes to write out types for functions and
references, and to not write out unnecessary function types.
diff --git a/binutils/debug.c b/binutils/debug.c
index 845658f..76bccc4 100644
--- a/binutils/debug.c
+++ b/binutils/debug.c
@@ -2576,7 +2576,7 @@ debug_write_type (info, fns, fhandle, type, name)
if (type->u.kclass != NULL)
{
if (info->class_mark == type->u.kclass->mark
- || type->u.kclass->id > info->base_id)
+ || (tag == NULL && type->u.kclass->id > info->base_id))
{
/* We are currently outputting this struct, or we have
already output it. I don't know if this can happen,
@@ -2586,8 +2586,11 @@ debug_write_type (info, fns, fhandle, type, name)
type->kind);
}
type->u.kclass->mark = info->class_mark;
- ++info->class_id;
- type->u.kclass->id = info->class_id;
+ if (tag == NULL)
+ {
+ ++info->class_id;
+ type->u.kclass->id = info->class_id;
+ }
}
if (! (*fns->start_struct_type) (fhandle, tag,
@@ -2748,7 +2751,7 @@ debug_write_class_type (info, fns, fhandle, type, tag)
else
{
if (info->class_mark == type->u.kclass->mark
- || type->u.kclass->id > info->base_id)
+ || (tag == NULL && type->u.kclass->id > info->base_id))
{
/* We are currently outputting this class, or we have
already output it. This can happen when there are
@@ -2758,9 +2761,12 @@ debug_write_class_type (info, fns, fhandle, type, tag)
type->kind);
}
type->u.kclass->mark = info->class_mark;
- ++info->class_id;
- id = info->class_id;
- type->u.kclass->id = id;
+ if (tag == NULL)
+ {
+ ++info->class_id;
+ type->u.kclass->id = info->class_id;
+ }
+ id = type->u.kclass->id;
vptrbase = type->u.kclass->vptrbase;
if (vptrbase != NULL && vptrbase != type)
diff --git a/binutils/ieee.c b/binutils/ieee.c
index 6b40985..9539320 100644
--- a/binutils/ieee.c
+++ b/binutils/ieee.c
@@ -4190,6 +4190,8 @@ ieee_define_named_type (info, name, tagp, id, size, unsignedp, ppbuf)
{
nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
memset (nt, 0, sizeof *nt);
+ if (tag != name)
+ tag = xstrdup (ab);
nt->name = tag;
nt->next = info->tags;
info->tags = nt;
@@ -5701,6 +5703,8 @@ ieee_tag_type (p, name, id, kind)
nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
memset (nt, 0, sizeof *nt);
+ if (name == ab)
+ name = xstrdup (ab);
nt->name = name;
nt->type.indx = info->type_indx;
++info->type_indx;