aboutsummaryrefslogtreecommitdiff
path: root/binutils/ieee.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-01-19 18:03:04 +0000
committerIan Lance Taylor <ian@airs.com>1996-01-19 18:03:04 +0000
commit07aa1e1b7a4a32b727bb943186680cbd3fc77b94 (patch)
tree4218394effa8aecb53d6e3e17f31e99bc716df86 /binutils/ieee.c
parent8c038399b5bda6b16758e4a264248b32ad5aa2de (diff)
downloadgdb-07aa1e1b7a4a32b727bb943186680cbd3fc77b94.zip
gdb-07aa1e1b7a4a32b727bb943186680cbd3fc77b94.tar.gz
gdb-07aa1e1b7a4a32b727bb943186680cbd3fc77b94.tar.bz2
* debug.h (enum debug_type_kind): Add DEBUG_KIND_ILLEGAL.
(struct debug_write_fns): Add field ellipsis_type. Add id parameter to start_struct_type, start_class_type, and tag_type. (debug_make_ellipsis_type): Declare. (debug_find_named_type): Declare. (debug_get_type_kind): Declare. (debug_get_return_type): Declare. (debug_get_parameter_types): Declare. (debug_get_fields): Declare. (debug_get_field_type): Declare. * debug.c (struct debug_handle): Add fields class_id and base_id. (struct debug_class_type): Add field id. (struct debug_method_variant): Rename argtypes to physname. Change all uses. (debug_ellipsis_type): New static variable. (ELLIPSIS_P): New macro. (debug_make_ellipsis_type): New function. (debug_make_method_variant): Rename argtypes to physname. (debug_make_static_method_variant): Likewise. (debug_name_type): Always put types in the global namespace. (debug_find_named_type): New function. (debug_find_tagged_type): Treat DEBUG_KIND_ILLEGAL specially, rather than DEBUG_KIND_VOID. (debug_get_real_type): New static function. (debug_get_type_kind): New function. (debug_get_return_type): New function. (debug_get_parameter_types): New function. (debug_get_fields): New function. (debug_get_field_type): New function. (debug_write): Initialize base_id. (debug_write_type): Pass new id argument to tag_type. Handle DEBUG_KIND_ILLEGAL. Use id for DEBUG_KIND_STRUCT and DEBUG_KIND_UNION. Handle ellipsis for method arguments. (debug_write_class_type): Don't dereference kclass if it is NULL. Use id. * prdbg.c (pr_fns): Add pr_ellipsis_type. (pr_ellipsis_type): New static function. (pr_pointer_type): If this is a pointer to an array, parenthesize it correctly. (pr_start_struct_type): Add id parameter. (pr_start_class_type): Likewise. (pr_tag_type): Likewise. (pr_fix_visibility): Add the visibility to the top of the stack, not the second element on the stack. (pr_struct_field): Pop the stack before calling pr_fix_visibility. (pr_class_static_member): Likewise. (pr_class_start_method): Don't push a type, just set the method name in the type on the top of the stack. (pr_class_end_method): Don't pop the stack. (pr_class_method_variant): Rename argtypes parameter to physname. Append const and volatile rather than prepending them. Add a space after the physname. (pr_class_static_method_variant): Likewise. * ieee.c (ieee_fns): Add ieee_ellipsis_type. (ieee_define_named_type): Use DEBUG_KIND_ILLEGAL rather than DEBUG_KIND_VOID. (write_ieee_debugging_info): Likewise. (ieee_typdef): Likewise. (ieee_ellipsis_type): New static function. (ieee_start_struct_type): Add id parameter. (ieee_start_class_type): Likewise. (ieee_tag_type): Likewise. (ieee_class_method_variant): Rename name to physname. (ieee_class_static_method_variant): Likewise.
Diffstat (limited to 'binutils/ieee.c')
-rw-r--r--binutils/ieee.c48
1 files changed, 33 insertions, 15 deletions
diff --git a/binutils/ieee.c b/binutils/ieee.c
index ac85f73..0006460 100644
--- a/binutils/ieee.c
+++ b/binutils/ieee.c
@@ -2267,7 +2267,7 @@ struct ieee_name_type
/* Type. */
struct ieee_write_type type;
/* If this is a tag which has not yet been defined, this is the
- kind. If the tag has been defined, this is DEBUG_KIND_VOID. */
+ kind. If the tag has been defined, this is DEBUG_KIND_ILLEGAL. */
enum debug_type_kind kind;
};
@@ -2357,6 +2357,7 @@ static boolean ieee_output_pending_parms PARAMS ((struct ieee_handle *));
static boolean ieee_start_compilation_unit PARAMS ((PTR, const char *));
static boolean ieee_start_source PARAMS ((PTR, const char *));
+static boolean ieee_ellipsis_type PARAMS ((PTR));
static boolean ieee_empty_type PARAMS ((PTR));
static boolean ieee_void_type PARAMS ((PTR));
static boolean ieee_int_type PARAMS ((PTR, unsigned int, boolean));
@@ -2377,12 +2378,13 @@ static boolean ieee_method_type PARAMS ((PTR, boolean, int));
static boolean ieee_const_type PARAMS ((PTR));
static boolean ieee_volatile_type PARAMS ((PTR));
static boolean ieee_start_struct_type
- PARAMS ((PTR, const char *, boolean, unsigned int));
+ PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int));
static boolean ieee_struct_field
PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility));
static boolean ieee_end_struct_type PARAMS ((PTR));
static boolean ieee_start_class_type
- PARAMS ((PTR, const char *, boolean, unsigned int, boolean, boolean));
+ PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean,
+ boolean));
static boolean ieee_class_static_member
PARAMS ((PTR, const char *, const char *, enum debug_visibility));
static boolean ieee_class_baseclass
@@ -2397,7 +2399,7 @@ static boolean ieee_class_end_method PARAMS ((PTR));
static boolean ieee_end_class_type PARAMS ((PTR));
static boolean ieee_typedef_type PARAMS ((PTR, const char *));
static boolean ieee_tag_type
- PARAMS ((PTR, const char *, enum debug_type_kind));
+ PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind));
static boolean ieee_typdef PARAMS ((PTR, const char *));
static boolean ieee_tag PARAMS ((PTR, const char *));
static boolean ieee_int_constant PARAMS ((PTR, const char *, bfd_vma));
@@ -2418,6 +2420,7 @@ static const struct debug_write_fns ieee_fns =
{
ieee_start_compilation_unit,
ieee_start_source,
+ ieee_ellipsis_type,
ieee_empty_type,
ieee_void_type,
ieee_int_type,
@@ -2797,7 +2800,7 @@ ieee_define_named_type (info, name, tagp, size, unsignedp, ppbuf)
nt->type.size = size;
nt->type.unsignedp = unsignedp;
- nt->kind = DEBUG_KIND_VOID;
+ nt->kind = DEBUG_KIND_ILLEGAL;
type_indx = nt->type.indx;
}
@@ -2878,7 +2881,7 @@ write_ieee_debugging_info (abfd, dhandle)
unsigned int name_indx;
char code;
- if (nt->kind == DEBUG_KIND_VOID)
+ if (nt->kind == DEBUG_KIND_ILLEGAL)
continue;
if (tags == NULL)
{
@@ -3158,6 +3161,15 @@ ieee_start_source (p, filename)
return true;
}
+/* Make an ellipsis type. */
+
+static boolean
+ieee_ellipsis_type (p)
+ PTR p;
+{
+ abort ();
+}
+
/* Make an empty type. */
static boolean
@@ -3598,9 +3610,10 @@ ieee_volatile_type (p)
fields with the struct type itself. */
static boolean
-ieee_start_struct_type (p, tag, structp, size)
+ieee_start_struct_type (p, tag, id, structp, size)
PTR p;
const char *tag;
+ unsigned int id;
boolean structp;
unsigned int size;
{
@@ -3699,9 +3712,10 @@ ieee_end_struct_type (p)
/* Start a class type. */
static boolean
-ieee_start_class_type (p, tag, structp, size, vptr, ownvptr)
+ieee_start_class_type (p, tag, id, structp, size, vptr, ownvptr)
PTR p;
const char *tag;
+ unsigned int id;
boolean structp;
unsigned int size;
boolean vptr;
@@ -3712,7 +3726,7 @@ ieee_start_class_type (p, tag, structp, size, vptr, ownvptr)
/* FIXME. */
if (vptr && ! ownvptr)
(void) ieee_pop_type (info);
- return ieee_start_struct_type (p, tag, structp, size);
+ return ieee_start_struct_type (p, tag, id, structp, size);
}
/* Add a static member to a class. */
@@ -3761,10 +3775,10 @@ ieee_class_start_method (p, name)
/* Define a new method variant. */
static boolean
-ieee_class_method_variant (p, name, visibility, constp, volatilep,
+ieee_class_method_variant (p, physname, visibility, constp, volatilep,
voffset, context)
PTR p;
- const char *name;
+ const char *physname;
enum debug_visibility visibility;
boolean constp;
boolean volatilep;
@@ -3783,9 +3797,9 @@ ieee_class_method_variant (p, name, visibility, constp, volatilep,
/* Define a new static method variant. */
static boolean
-ieee_class_static_method_variant (p, name, visibility, constp, volatilep)
+ieee_class_static_method_variant (p, physname, visibility, constp, volatilep)
PTR p;
- const char *name;
+ const char *physname;
enum debug_visibility visibility;
boolean constp;
boolean volatilep;
@@ -3846,14 +3860,18 @@ ieee_typedef_type (p, name)
/* Push a tagged type onto the type stack. */
static boolean
-ieee_tag_type (p, name, kind)
+ieee_tag_type (p, name, id, kind)
PTR p;
const char *name;
+ unsigned int id;
enum debug_type_kind kind;
{
struct ieee_handle *info = (struct ieee_handle *) p;
register struct ieee_name_type *nt;
+ if (name == NULL)
+ return true;
+
for (nt = info->tags; nt != NULL; nt = nt->next)
{
if (nt->name[0] == name[0]
@@ -3899,7 +3917,7 @@ ieee_typdef (p, name)
memset (nt, 0, sizeof *nt);
nt->name = name;
nt->type = info->type_stack->type;
- nt->kind = DEBUG_KIND_VOID;
+ nt->kind = DEBUG_KIND_ILLEGAL;
nt->next = info->typedefs;
info->typedefs = nt;