Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Typedefs | Enumerations | Functions
debug.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  debug_write_fns

Defines

#define DEBUG_TYPE_NULL   ((debug_type) NULL)
#define DEBUG_FIELD_NULL   ((debug_field) NULL)
#define DEBUG_BASECLASS_NULL   ((debug_baseclass) NULL)
#define DEBUG_METHOD_NULL   ((debug_method) NULL)
#define DEBUG_METHOD_VARIANT_NULL   ((debug_method_variant) NULL)

Typedefs

typedef struct debug_typedebug_type
typedef struct debug_fielddebug_field
typedef struct debug_baseclassdebug_baseclass
typedef struct debug_methoddebug_method
typedef struct
debug_method_variant
debug_method_variant

Enumerations

enum  debug_type_kind {
  DEBUG_KIND_ILLEGAL, DEBUG_KIND_INDIRECT, DEBUG_KIND_VOID, DEBUG_KIND_INT,
  DEBUG_KIND_FLOAT, DEBUG_KIND_COMPLEX, DEBUG_KIND_BOOL, DEBUG_KIND_STRUCT,
  DEBUG_KIND_UNION, DEBUG_KIND_CLASS, DEBUG_KIND_UNION_CLASS, DEBUG_KIND_ENUM,
  DEBUG_KIND_POINTER, DEBUG_KIND_FUNCTION, DEBUG_KIND_REFERENCE, DEBUG_KIND_RANGE,
  DEBUG_KIND_ARRAY, DEBUG_KIND_SET, DEBUG_KIND_OFFSET, DEBUG_KIND_METHOD,
  DEBUG_KIND_CONST, DEBUG_KIND_VOLATILE, DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED
}
enum  debug_var_kind {
  DEBUG_VAR_ILLEGAL, DEBUG_GLOBAL, DEBUG_STATIC, DEBUG_LOCAL_STATIC,
  DEBUG_LOCAL, DEBUG_REGISTER
}
enum  debug_parm_kind {
  DEBUG_PARM_ILLEGAL, DEBUG_PARM_STACK, DEBUG_PARM_REG, DEBUG_PARM_REFERENCE,
  DEBUG_PARM_REF_REG
}
enum  debug_visibility { DEBUG_VISIBILITY_PUBLIC, DEBUG_VISIBILITY_PROTECTED, DEBUG_VISIBILITY_PRIVATE, DEBUG_VISIBILITY_IGNORE }

Functions

void * debug_init (void)
bfd_boolean debug_set_filename (void *, const char *)
bfd_boolean debug_start_source (void *, const char *)
bfd_boolean debug_record_function (void *, const char *, debug_type, bfd_boolean, bfd_vma)
bfd_boolean debug_record_parameter (void *, const char *, debug_type, enum debug_parm_kind, bfd_vma)
bfd_boolean debug_end_function (void *, bfd_vma)
bfd_boolean debug_start_block (void *, bfd_vma)
bfd_boolean debug_end_block (void *, bfd_vma)
bfd_boolean debug_record_line (void *, unsigned long, bfd_vma)
bfd_boolean debug_start_common_block (void *, const char *)
bfd_boolean debug_end_common_block (void *, const char *)
bfd_boolean debug_record_int_const (void *, const char *, bfd_vma)
bfd_boolean debug_record_float_const (void *, const char *, double)
bfd_boolean debug_record_typed_const (void *, const char *, debug_type, bfd_vma)
bfd_boolean debug_record_label (void *, const char *, debug_type, bfd_vma)
bfd_boolean debug_record_variable (void *, const char *, debug_type, enum debug_var_kind, bfd_vma)
debug_type debug_make_indirect_type (void *, debug_type *, const char *)
debug_type debug_make_void_type (void *)
debug_type debug_make_int_type (void *, unsigned int, bfd_boolean)
debug_type debug_make_float_type (void *, unsigned int)
debug_type debug_make_bool_type (void *, unsigned int)
debug_type debug_make_complex_type (void *, unsigned int)
debug_type debug_make_struct_type (void *, bfd_boolean, bfd_vma, debug_field *)
debug_type debug_make_object_type (void *, bfd_boolean, bfd_vma, debug_field *, debug_baseclass *, debug_method *, debug_type, bfd_boolean)
debug_type debug_make_enum_type (void *, const char **, bfd_signed_vma *)
debug_type debug_make_pointer_type (void *, debug_type)
debug_type debug_make_function_type (void *, debug_type, debug_type *, bfd_boolean)
debug_type debug_make_reference_type (void *, debug_type)
debug_type debug_make_range_type (void *, debug_type, bfd_signed_vma, bfd_signed_vma)
debug_type debug_make_array_type (void *, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma, bfd_boolean)
debug_type debug_make_set_type (void *, debug_type, bfd_boolean)
debug_type debug_make_offset_type (void *, debug_type, debug_type)
debug_type debug_make_method_type (void *, debug_type, debug_type, debug_type *, bfd_boolean)
debug_type debug_make_const_type (void *, debug_type)
debug_type debug_make_volatile_type (void *, debug_type)
debug_type debug_make_undefined_tagged_type (void *, const char *, enum debug_type_kind)
debug_baseclass debug_make_baseclass (void *, debug_type, bfd_vma, bfd_boolean, enum debug_visibility)
debug_field debug_make_field (void *, const char *, debug_type, bfd_vma, bfd_vma, enum debug_visibility)
debug_field debug_make_static_member (void *, const char *, debug_type, const char *, enum debug_visibility)
debug_method debug_make_method (void *, const char *, debug_method_variant *)
debug_method_variant debug_make_method_variant (void *, const char *, debug_type, enum debug_visibility, bfd_boolean, bfd_boolean, bfd_vma, debug_type)
debug_method_variant debug_make_static_method_variant (void *, const char *, debug_type, enum debug_visibility, bfd_boolean, bfd_boolean)
debug_type debug_name_type (void *, const char *, debug_type)
debug_type debug_tag_type (void *, const char *, debug_type)
bfd_boolean debug_record_type_size (void *, debug_type, unsigned int)
debug_type debug_find_named_type (void *, const char *)
debug_type debug_find_tagged_type (void *, const char *, enum debug_type_kind)
enum debug_type_kind debug_get_type_kind (void *, debug_type)
const char * debug_get_type_name (void *, debug_type)
bfd_vma debug_get_type_size (void *, debug_type)
debug_type debug_get_return_type (void *, debug_type)
const debug_typedebug_get_parameter_types (void *, debug_type, bfd_boolean *)
debug_type debug_get_target_type (void *, debug_type)
const debug_fielddebug_get_fields (void *, debug_type)
debug_type debug_get_field_type (void *, debug_field)
const char * debug_get_field_name (void *, debug_field)
bfd_vma debug_get_field_bitpos (void *, debug_field)
bfd_vma debug_get_field_bitsize (void *, debug_field)
enum debug_visibility debug_get_field_visibility (void *, debug_field)
const char * debug_get_field_physname (void *, debug_field)
bfd_boolean debug_write (void *, const struct debug_write_fns *, void *)

Define Documentation

Definition at line 149 of file debug.h.

#define DEBUG_FIELD_NULL   ((debug_field) NULL)

Definition at line 143 of file debug.h.

Definition at line 155 of file debug.h.

Definition at line 162 of file debug.h.

#define DEBUG_TYPE_NULL   ((debug_type) NULL)

Definition at line 137 of file debug.h.


Typedef Documentation

Definition at line 147 of file debug.h.

Definition at line 141 of file debug.h.

Definition at line 153 of file debug.h.

Definition at line 160 of file debug.h.

Definition at line 135 of file debug.h.


Enumeration Type Documentation

Enumerator:
DEBUG_PARM_ILLEGAL 
DEBUG_PARM_STACK 
DEBUG_PARM_REG 
DEBUG_PARM_REFERENCE 
DEBUG_PARM_REF_REG 

Definition at line 105 of file debug.h.

{
  /* Not used.  */
  DEBUG_PARM_ILLEGAL,
  /* A stack based parameter.  */
  DEBUG_PARM_STACK,
  /* A register parameter.  */
  DEBUG_PARM_REG,
  /* A stack based reference parameter.  */
  DEBUG_PARM_REFERENCE,
  /* A register reference parameter.  */
  DEBUG_PARM_REF_REG
};
Enumerator:
DEBUG_KIND_ILLEGAL 
DEBUG_KIND_INDIRECT 
DEBUG_KIND_VOID 
DEBUG_KIND_INT 
DEBUG_KIND_FLOAT 
DEBUG_KIND_COMPLEX 
DEBUG_KIND_BOOL 
DEBUG_KIND_STRUCT 
DEBUG_KIND_UNION 
DEBUG_KIND_CLASS 
DEBUG_KIND_UNION_CLASS 
DEBUG_KIND_ENUM 
DEBUG_KIND_POINTER 
DEBUG_KIND_FUNCTION 
DEBUG_KIND_REFERENCE 
DEBUG_KIND_RANGE 
DEBUG_KIND_ARRAY 
DEBUG_KIND_SET 
DEBUG_KIND_OFFSET 
DEBUG_KIND_METHOD 
DEBUG_KIND_CONST 
DEBUG_KIND_VOLATILE 
DEBUG_KIND_NAMED 
DEBUG_KIND_TAGGED 

Definition at line 33 of file debug.h.

{
  /* Not used.  */
  DEBUG_KIND_ILLEGAL,
  /* Indirect via a pointer.  */
  DEBUG_KIND_INDIRECT,
  /* Void.  */
  DEBUG_KIND_VOID,
  /* Integer.  */
  DEBUG_KIND_INT,
  /* Floating point.  */
  DEBUG_KIND_FLOAT,
  /* Complex.  */
  DEBUG_KIND_COMPLEX,
  /* Boolean.  */
  DEBUG_KIND_BOOL,
  /* Struct.  */
  DEBUG_KIND_STRUCT,
  /* Union.  */
  DEBUG_KIND_UNION,
  /* Class.  */
  DEBUG_KIND_CLASS,
  /* Union class (can this really happen?).  */
  DEBUG_KIND_UNION_CLASS,
  /* Enumeration type.  */
  DEBUG_KIND_ENUM,
  /* Pointer.  */
  DEBUG_KIND_POINTER,
  /* Function.  */
  DEBUG_KIND_FUNCTION,
  /* Reference.  */
  DEBUG_KIND_REFERENCE,
  /* Range.  */
  DEBUG_KIND_RANGE,
  /* Array.  */
  DEBUG_KIND_ARRAY,
  /* Set.  */
  DEBUG_KIND_SET,
  /* Based pointer.  */
  DEBUG_KIND_OFFSET,
  /* Method.  */
  DEBUG_KIND_METHOD,
  /* Const qualified type.  */
  DEBUG_KIND_CONST,
  /* Volatile qualified type.  */
  DEBUG_KIND_VOLATILE,
  /* Named type.  */
  DEBUG_KIND_NAMED,
  /* Tagged type.  */
  DEBUG_KIND_TAGGED
};
Enumerator:
DEBUG_VAR_ILLEGAL 
DEBUG_GLOBAL 
DEBUG_STATIC 
DEBUG_LOCAL_STATIC 
DEBUG_LOCAL 
DEBUG_REGISTER 

Definition at line 87 of file debug.h.

{
  /* Not used.  */
  DEBUG_VAR_ILLEGAL,
  /* A global variable.  */
  DEBUG_GLOBAL,
  /* A static variable.  */
  DEBUG_STATIC,
  /* A local static variable.  */
  DEBUG_LOCAL_STATIC,
  /* A local variable.  */
  DEBUG_LOCAL,
  /* A register variable.  */
  DEBUG_REGISTER
};
Enumerator:
DEBUG_VISIBILITY_PUBLIC 
DEBUG_VISIBILITY_PROTECTED 
DEBUG_VISIBILITY_PRIVATE 
DEBUG_VISIBILITY_IGNORE 

Definition at line 121 of file debug.h.

{
  /* A public field (e.g., a field in a C struct).  */
  DEBUG_VISIBILITY_PUBLIC,
  /* A protected field.  */
  DEBUG_VISIBILITY_PROTECTED,
  /* A private field.  */
  DEBUG_VISIBILITY_PRIVATE,
  /* A field which should be ignored.  */
  DEBUG_VISIBILITY_IGNORE
};

Function Documentation

bfd_boolean debug_end_block ( void *  ,
bfd_vma   
)

Definition at line 929 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_block *parent;

  if (info->current_unit == NULL
      || info->current_block == NULL)
    {
      debug_error (_("debug_end_block: no current block"));
      return FALSE;
    }

  parent = info->current_block->parent;
  if (parent == NULL)
    {
      debug_error (_("debug_end_block: attempt to close top level block"));
      return FALSE;
    }

  info->current_block->end = addr;

  info->current_block = parent;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_end_common_block ( void *  ,
const char *   
)
bfd_boolean debug_end_function ( void *  ,
bfd_vma   
)

Definition at line 859 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;

  if (info->current_unit == NULL
      || info->current_block == NULL
      || info->current_function == NULL)
    {
      debug_error (_("debug_end_function: no current function"));
      return FALSE;
    }

  if (info->current_block->parent != NULL)
    {
      debug_error (_("debug_end_function: some blocks were not closed"));
      return FALSE;
    }

  info->current_block->end = addr;

  info->current_function = NULL;
  info->current_block = NULL;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_find_named_type ( void *  ,
const char *   
)

Definition at line 1943 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_block *b;
  struct debug_file *f;

  /* We only search the current compilation unit.  I don't know if
     this is right or not.  */

  if (info->current_unit == NULL)
    {
      debug_error (_("debug_find_named_type: no current compilation unit"));
      return DEBUG_TYPE_NULL;
    }

  for (b = info->current_block; b != NULL; b = b->parent)
    {
      if (b->locals != NULL)
       {
         struct debug_name *n;

         for (n = b->locals->list; n != NULL; n = n->next)
           {
             if (n->kind == DEBUG_OBJECT_TYPE
                && n->name[0] == name[0]
                && strcmp (n->name, name) == 0)
              return n->u.type;
           }
       }
    }

  for (f = info->current_unit->files; f != NULL; f = f->next)
    {
      if (f->globals != NULL)
       {
         struct debug_name *n;

         for (n = f->globals->list; n != NULL; n = n->next)
           {
             if (n->kind == DEBUG_OBJECT_TYPE
                && n->name[0] == name[0]
                && strcmp (n->name, name) == 0)
              return n->u.type;
           }
       }
    }

  return DEBUG_TYPE_NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_find_tagged_type ( void *  ,
const char *  ,
enum  debug_type_kind 
)

Definition at line 1996 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_unit *u;

  /* We search the globals of all the compilation units.  I don't know
     if this is correct or not.  It would be easy to change.  */

  for (u = info->units; u != NULL; u = u->next)
    {
      struct debug_file *f;

      for (f = u->files; f != NULL; f = f->next)
       {
         struct debug_name *n;

         if (f->globals != NULL)
           {
             for (n = f->globals->list; n != NULL; n = n->next)
              {
                if (n->kind == DEBUG_OBJECT_TAG
                    && (kind == DEBUG_KIND_ILLEGAL
                       || n->u.tag->kind == kind)
                    && n->name[0] == name[0]
                    && strcmp (n->name, name) == 0)
                  return n->u.tag;
              }
           }
       }
    }

  return DEBUG_TYPE_NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* debug_get_field_name ( void *  ,
debug_field   
)
const char* debug_get_field_physname ( void *  ,
debug_field   
)

Definition at line 2224 of file debug.c.

{
  if (type == NULL)
    return NULL;

  type = debug_get_real_type (handle, type, NULL);
  if (type == NULL)
    return NULL;

  switch (type->kind)
    {
    default:
      return NULL;
    case DEBUG_KIND_STRUCT:
    case DEBUG_KIND_UNION:
    case DEBUG_KIND_CLASS:
    case DEBUG_KIND_UNION_CLASS:
      return type->u.kclass->fields;
    }
  /*NOTREACHED*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2168 of file debug.c.

{
  if (type == NULL)
    return NULL;

  type = debug_get_real_type (handle, type, NULL);
  if (type == NULL)
    return NULL;

  switch (type->kind)
    {
    default:
      return NULL;
    case DEBUG_KIND_FUNCTION:
      *pvarargs = type->u.kfunction->varargs;
      return type->u.kfunction->arg_types;
    case DEBUG_KIND_METHOD:
      *pvarargs = type->u.kmethod->varargs;
      return type->u.kmethod->arg_types;
    }
  /*NOTREACHED*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2143 of file debug.c.

{
  if (type == NULL)
    return DEBUG_TYPE_NULL;

  type = debug_get_real_type (handle, type, NULL);
  if (type == NULL)
    return DEBUG_TYPE_NULL;

  switch (type->kind)
    {
    default:
      return DEBUG_TYPE_NULL;
    case DEBUG_KIND_FUNCTION:
      return type->u.kfunction->return_type;
    case DEBUG_KIND_METHOD:
      return type->u.kmethod->return_type;
    }
  /*NOTREACHED*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2195 of file debug.c.

{
  if (type == NULL)
    return NULL;

  type = debug_get_real_type (handle, type, NULL);
  if (type == NULL)
    return NULL;

  switch (type->kind)
    {
    default:
      return NULL;
    case DEBUG_KIND_POINTER:
      return type->u.kpointer;
    case DEBUG_KIND_REFERENCE:
      return type->u.kreference;
    case DEBUG_KIND_CONST:
      return type->u.kconst;
    case DEBUG_KIND_VOLATILE:
      return type->u.kvolatile;
    }
  /*NOTREACHED*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2084 of file debug.c.

{
  if (type == NULL)
    return DEBUG_KIND_ILLEGAL;
  type = debug_get_real_type (handle, type, NULL);
  if (type == NULL)
    return DEBUG_KIND_ILLEGAL;
  return type->kind;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* debug_get_type_name ( void *  ,
debug_type   
)

Definition at line 2097 of file debug.c.

{
  if (type->kind == DEBUG_KIND_INDIRECT)
    {
      if (*type->u.kindirect->slot != NULL)
       return debug_get_type_name (handle, *type->u.kindirect->slot);
      return type->u.kindirect->tag;
    }
  if (type->kind == DEBUG_KIND_NAMED
      || type->kind == DEBUG_KIND_TAGGED)
    return type->u.knamed->name->name;
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_vma debug_get_type_size ( void *  ,
debug_type   
)

Definition at line 2114 of file debug.c.

{
  if (type == NULL)
    return 0;

  /* We don't call debug_get_real_type, because somebody might have
     called debug_record_type_size on a named or indirect type.  */

  if (type->size != 0)
    return type->size;

  switch (type->kind)
    {
    default:
      return 0;
    case DEBUG_KIND_INDIRECT:
      if (*type->u.kindirect->slot != NULL)
       return debug_get_type_size (handle, *type->u.kindirect->slot);
      return 0;
    case DEBUG_KIND_NAMED:
    case DEBUG_KIND_TAGGED:
      return debug_get_type_size (handle, type->u.knamed->type);
    }
  /*NOTREACHED*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* debug_init ( void  )

Definition at line 663 of file debug.c.

{
  struct debug_handle *ret;

  ret = (struct debug_handle *) xmalloc (sizeof *ret);
  memset (ret, 0, sizeof *ret);
  return (void *) ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1480 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_array_type *a;

  if (element_type == NULL || range_type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_ARRAY, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  a = (struct debug_array_type *) xmalloc (sizeof *a);
  memset (a, 0, sizeof *a);

  a->element_type = element_type;
  a->range_type = range_type;
  a->lower = lower;
  a->upper = upper;
  a->stringp = stringp;

  t->u.karray = a;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_baseclass debug_make_baseclass ( void *  ,
debug_type  ,
bfd_vma  ,
bfd_boolean  ,
enum  debug_visibility 
)
debug_type debug_make_bool_type ( void *  ,
unsigned  int 
)

Definition at line 1259 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;

  return debug_make_type (info, DEBUG_KIND_BOOL, size);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1269 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;

  return debug_make_type (info, DEBUG_KIND_COMPLEX, size);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1605 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_CONST, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  t->u.kconst = type;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_make_enum_type ( void *  ,
const char **  ,
bfd_signed_vma  
)

Definition at line 1347 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_enum_type *e;

  t = debug_make_type (info, DEBUG_KIND_ENUM, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  e = (struct debug_enum_type *) xmalloc (sizeof *e);
  memset (e, 0, sizeof *e);

  e->names = names;
  e->values = values;

  t->u.kenum = e;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_field debug_make_field ( void *  ,
const char *  ,
debug_type  ,
bfd_vma  ,
bfd_vma  ,
enum  debug_visibility 
)
debug_type debug_make_float_type ( void *  ,
unsigned  int 
)

Definition at line 1249 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;

  return debug_make_type (info, DEBUG_KIND_FLOAT, size);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1398 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_function_type *f;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_FUNCTION, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  f = (struct debug_function_type *) xmalloc (sizeof *f);
  memset (f, 0, sizeof *f);

  f->return_type = type;
  f->arg_types = arg_types;
  f->varargs = varargs;

  t->u.kfunction = f;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_make_indirect_type ( void *  ,
debug_type ,
const char *   
)

Definition at line 1195 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_indirect_type *i;

  t = debug_make_type (info, DEBUG_KIND_INDIRECT, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  i = (struct debug_indirect_type *) xmalloc (sizeof *i);
  memset (i, 0, sizeof *i);

  i->slot = slot;
  i->tag = tag;

  t->u.kindirect = i;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_make_int_type ( void *  ,
unsigned  int,
bfd_boolean   
)

Definition at line 1230 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;

  t = debug_make_type (info, DEBUG_KIND_INT, size);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  t->u.kint = unsignedp;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_method debug_make_method ( void *  ,
const char *  ,
debug_method_variant  
)

Definition at line 1574 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_method_type *m;

  if (return_type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_METHOD, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  m = (struct debug_method_type *) xmalloc (sizeof *m);
  memset (m, 0, sizeof *m);

  m->return_type = return_type;
  m->domain_type = domain_type;
  m->arg_types = arg_types;
  m->varargs = varargs;

  t->u.kmethod = m;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_method_variant debug_make_method_variant ( void *  ,
const char *  ,
debug_type  ,
enum  debug_visibility,
bfd_boolean  ,
bfd_boolean  ,
bfd_vma  ,
debug_type   
)

Definition at line 1312 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_class_type *c;

  t = debug_make_type (info,
                     structp ? DEBUG_KIND_CLASS : DEBUG_KIND_UNION_CLASS,
                     size);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  c = (struct debug_class_type *) xmalloc (sizeof *c);
  memset (c, 0, sizeof *c);

  c->fields = fields;
  c->baseclasses = baseclasses;
  c->methods = methods;
  if (ownvptr)
    c->vptrbase = t;
  else
    c->vptrbase = vptrbase;

  t->u.kclass = c;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1544 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_offset_type *o;

  if (base_type == NULL || target_type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_OFFSET, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  o = (struct debug_offset_type *) xmalloc (sizeof *o);
  memset (o, 0, sizeof *o);

  o->base_type = base_type;
  o->target_type = target_type;

  t->u.koffset = o;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1372 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  if (type->pointer != DEBUG_TYPE_NULL)
    return type->pointer;

  t = debug_make_type (info, DEBUG_KIND_POINTER, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  t->u.kpointer = type;

  type->pointer = t;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1447 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_range_type *r;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_RANGE, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  r = (struct debug_range_type *) xmalloc (sizeof *r);
  memset (r, 0, sizeof *r);

  r->type = type;
  r->lower = lower;
  r->upper = upper;

  t->u.krange = r;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1427 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_REFERENCE, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  t->u.kreference = type;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1514 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_set_type *s;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_SET, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  s = (struct debug_set_type *) xmalloc (sizeof *s);
  memset (s, 0, sizeof *s);

  s->type = type;
  s->bitstringp = bitstringp;

  t->u.kset = s;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_field debug_make_static_member ( void *  ,
const char *  ,
debug_type  ,
const char *  ,
enum  debug_visibility 
)
debug_method_variant debug_make_static_method_variant ( void *  ,
const char *  ,
debug_type  ,
enum  debug_visibility,
bfd_boolean  ,
bfd_boolean   
)

Definition at line 1281 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_class_type *c;

  t = debug_make_type (info,
                     structp ? DEBUG_KIND_STRUCT : DEBUG_KIND_UNION,
                     size);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  c = (struct debug_class_type *) xmalloc (sizeof *c);
  memset (c, 0, sizeof *c);

  c->fields = fields;

  t->u.kclass = c;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_make_undefined_tagged_type ( void *  ,
const char *  ,
enum  debug_type_kind 
)

Definition at line 1646 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;

  if (name == NULL)
    return DEBUG_TYPE_NULL;

  switch (kind)
    {
    case DEBUG_KIND_STRUCT:
    case DEBUG_KIND_UNION:
    case DEBUG_KIND_CLASS:
    case DEBUG_KIND_UNION_CLASS:
    case DEBUG_KIND_ENUM:
      break;

    default:
      debug_error (_("debug_make_undefined_type: unsupported kind"));
      return DEBUG_TYPE_NULL;
    }

  t = debug_make_type (info, kind, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  return debug_tag_type (handle, name, t);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1219 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;

  return debug_make_type (info, DEBUG_KIND_VOID, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1625 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;

  if (type == NULL)
    return DEBUG_TYPE_NULL;

  t = debug_make_type (info, DEBUG_KIND_VOLATILE, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  t->u.kvolatile = type;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_name_type ( void *  ,
const char *  ,
debug_type   
)

Definition at line 1829 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_named_type *n;
  struct debug_name *nm;

  if (name == NULL || type == NULL)
    return DEBUG_TYPE_NULL;

  if (info->current_unit == NULL
      || info->current_file == NULL)
    {
      debug_error (_("debug_name_type: no current file"));
      return DEBUG_TYPE_NULL;
    }

  t = debug_make_type (info, DEBUG_KIND_NAMED, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  n = (struct debug_named_type *) xmalloc (sizeof *n);
  memset (n, 0, sizeof *n);

  n->type = type;

  t->u.knamed = n;

  /* We always add the name to the global namespace.  This is probably
     wrong in some cases, but it seems to be right for stabs.  FIXME.  */

  nm = debug_add_to_namespace (info, &info->current_file->globals, name,
                            DEBUG_OBJECT_TYPE, DEBUG_LINKAGE_NONE);
  if (nm == NULL)
    return DEBUG_TYPE_NULL;

  nm->u.type = t;

  n->name = nm;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_float_const ( void *  ,
const char *  ,
double   
)

Definition at line 1059 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_name *n;

  if (name == NULL)
    return FALSE;

  n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_FLOAT_CONSTANT,
                                  DEBUG_LINKAGE_NONE);
  if (n == NULL)
    return FALSE;

  n->u.float_constant = val;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_function ( void *  ,
const char *  ,
debug_type  ,
bfd_boolean  ,
bfd_vma   
)

Definition at line 767 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_function *f;
  struct debug_block *b;
  struct debug_name *n;

  if (name == NULL)
    name = "";
  if (return_type == NULL)
    return FALSE;

  if (info->current_unit == NULL)
    {
      debug_error (_("debug_record_function: no debug_set_filename call"));
      return FALSE;
    }

  f = (struct debug_function *) xmalloc (sizeof *f);
  memset (f, 0, sizeof *f);

  f->return_type = return_type;

  b = (struct debug_block *) xmalloc (sizeof *b);
  memset (b, 0, sizeof *b);

  b->start = addr;
  b->end = (bfd_vma) -1;

  f->blocks = b;

  info->current_function = f;
  info->current_block = b;

  /* FIXME: If we could handle nested functions, this would be the
     place: we would want to use a different namespace.  */
  n = debug_add_to_namespace (info,
                           &info->current_file->globals,
                           name,
                           DEBUG_OBJECT_FUNCTION,
                           (global
                            ? DEBUG_LINKAGE_GLOBAL
                            : DEBUG_LINKAGE_STATIC));
  if (n == NULL)
    return FALSE;

  n->u.function = f;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_int_const ( void *  ,
const char *  ,
bfd_vma   
)

Definition at line 1038 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_name *n;

  if (name == NULL)
    return FALSE;

  n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_INT_CONSTANT,
                                  DEBUG_LINKAGE_NONE);
  if (n == NULL)
    return FALSE;

  n->u.int_constant = val;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_label ( void *  ,
const char *  ,
debug_type  ,
bfd_vma   
)
bfd_boolean debug_record_line ( void *  ,
unsigned  long,
bfd_vma   
)

Definition at line 959 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_lineno *l;
  unsigned int i;

  if (info->current_unit == NULL)
    {
      debug_error (_("debug_record_line: no current unit"));
      return FALSE;
    }

  l = info->current_lineno;
  if (l != NULL && l->file == info->current_file)
    {
      for (i = 0; i < DEBUG_LINENO_COUNT; i++)
       {
         if (l->linenos[i] == (unsigned long) -1)
           {
             l->linenos[i] = lineno;
             l->addrs[i] = addr;
             return TRUE;
           }
       }
    }

  /* If we get here, then either 1) there is no current_lineno
     structure, which means this is the first line number in this
     compilation unit, 2) the current_lineno structure is for a
     different file, or 3) the current_lineno structure is full.
     Regardless, we want to allocate a new debug_lineno structure, put
     it in the right place, and make it the new current_lineno
     structure.  */

  l = (struct debug_lineno *) xmalloc (sizeof *l);
  memset (l, 0, sizeof *l);

  l->file = info->current_file;
  l->linenos[0] = lineno;
  l->addrs[0] = addr;
  for (i = 1; i < DEBUG_LINENO_COUNT; i++)
    l->linenos[i] = (unsigned long) -1;

  if (info->current_lineno != NULL)
    info->current_lineno->next = l;
  else
    info->current_unit->linenos = l;

  info->current_lineno = l;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_parameter ( void *  ,
const char *  ,
debug_type  ,
enum  debug_parm_kind,
bfd_vma   
)

Definition at line 823 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_parameter *p, **pp;

  if (name == NULL || type == NULL)
    return FALSE;

  if (info->current_unit == NULL
      || info->current_function == NULL)
    {
      debug_error (_("debug_record_parameter: no current function"));
      return FALSE;
    }

  p = (struct debug_parameter *) xmalloc (sizeof *p);
  memset (p, 0, sizeof *p);

  p->name = name;
  p->type = type;
  p->kind = kind;
  p->val = val;

  for (pp = &info->current_function->parameters;
       *pp != NULL;
       pp = &(*pp)->next)
    ;
  *pp = p;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_typed_const ( void *  ,
const char *  ,
debug_type  ,
bfd_vma   
)

Definition at line 1080 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_name *n;
  struct debug_typed_constant *tc;

  if (name == NULL || type == NULL)
    return FALSE;

  n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_TYPED_CONSTANT,
                                  DEBUG_LINKAGE_NONE);
  if (n == NULL)
    return FALSE;

  tc = (struct debug_typed_constant *) xmalloc (sizeof *tc);
  memset (tc, 0, sizeof *tc);

  tc->type = type;
  tc->val = val;

  n->u.typed_constant = tc;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_record_variable ( void *  ,
const char *  ,
debug_type  ,
enum  debug_var_kind,
bfd_vma   
)

Definition at line 1122 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_namespace **nsp;
  enum debug_object_linkage linkage;
  struct debug_name *n;
  struct debug_variable *v;

  if (name == NULL || type == NULL)
    return FALSE;

  if (info->current_unit == NULL
      || info->current_file == NULL)
    {
      debug_error (_("debug_record_variable: no current file"));
      return FALSE;
    }

  if (kind == DEBUG_GLOBAL || kind == DEBUG_STATIC)
    {
      nsp = &info->current_file->globals;
      if (kind == DEBUG_GLOBAL)
       linkage = DEBUG_LINKAGE_GLOBAL;
      else
       linkage = DEBUG_LINKAGE_STATIC;
    }
  else
    {
      if (info->current_block == NULL)
       nsp = &info->current_file->globals;
      else
       nsp = &info->current_block->locals;
      linkage = DEBUG_LINKAGE_AUTOMATIC;
    }

  n = debug_add_to_namespace (info, nsp, name, DEBUG_OBJECT_VARIABLE, linkage);
  if (n == NULL)
    return FALSE;

  v = (struct debug_variable *) xmalloc (sizeof *v);
  memset (v, 0, sizeof *v);

  v->kind = kind;
  v->type = type;
  v->val = val;

  n->u.variable = v;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_set_filename ( void *  ,
const char *   
)

Definition at line 676 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_file *nfile;
  struct debug_unit *nunit;

  if (name == NULL)
    name = "";

  nfile = (struct debug_file *) xmalloc (sizeof *nfile);
  memset (nfile, 0, sizeof *nfile);

  nfile->filename = name;

  nunit = (struct debug_unit *) xmalloc (sizeof *nunit);
  memset (nunit, 0, sizeof *nunit);

  nunit->files = nfile;
  info->current_file = nfile;

  if (info->current_unit != NULL)
    info->current_unit->next = nunit;
  else
    {
      assert (info->units == NULL);
      info->units = nunit;
    }

  info->current_unit = nunit;

  info->current_function = NULL;
  info->current_block = NULL;
  info->current_lineno = NULL;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_start_block ( void *  ,
bfd_vma   
)

Definition at line 891 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_block *b, **pb;

  /* We must always have a current block: debug_record_function sets
     one up.  */
  if (info->current_unit == NULL
      || info->current_block == NULL)
    {
      debug_error (_("debug_start_block: no current block"));
      return FALSE;
    }

  b = (struct debug_block *) xmalloc (sizeof *b);
  memset (b, 0, sizeof *b);

  b->parent = info->current_block;
  b->start = addr;
  b->end = (bfd_vma) -1;

  /* This new block is a child of the current block.  */
  for (pb = &info->current_block->children;
       *pb != NULL;
       pb = &(*pb)->next)
    ;
  *pb = b;

  info->current_block = b;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_start_common_block ( void *  ,
const char *   
)
bfd_boolean debug_start_source ( void *  ,
const char *   
)

Definition at line 717 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_file *f, **pf;

  if (name == NULL)
    name = "";

  if (info->current_unit == NULL)
    {
      debug_error (_("debug_start_source: no debug_set_filename call"));
      return FALSE;
    }

  for (f = info->current_unit->files; f != NULL; f = f->next)
    {
      if (f->filename[0] == name[0]
         && f->filename[1] == name[1]
         && strcmp (f->filename, name) == 0)
       {
         info->current_file = f;
         return TRUE;
       }
    }

  f = (struct debug_file *) xmalloc (sizeof *f);
  memset (f, 0, sizeof *f);

  f->filename = name;

  for (pf = &info->current_file->next;
       *pf != NULL;
       pf = &(*pf)->next)
    ;
  *pf = f;

  info->current_file = f;

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

debug_type debug_tag_type ( void *  ,
const char *  ,
debug_type   
)

Definition at line 1875 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_type *t;
  struct debug_named_type *n;
  struct debug_name *nm;

  if (name == NULL || type == NULL)
    return DEBUG_TYPE_NULL;

  if (info->current_file == NULL)
    {
      debug_error (_("debug_tag_type: no current file"));
      return DEBUG_TYPE_NULL;
    }

  if (type->kind == DEBUG_KIND_TAGGED)
    {
      if (strcmp (type->u.knamed->name->name, name) == 0)
       return type;
      debug_error (_("debug_tag_type: extra tag attempted"));
      return DEBUG_TYPE_NULL;
    }

  t = debug_make_type (info, DEBUG_KIND_TAGGED, 0);
  if (t == NULL)
    return DEBUG_TYPE_NULL;

  n = (struct debug_named_type *) xmalloc (sizeof *n);
  memset (n, 0, sizeof *n);

  n->type = type;

  t->u.knamed = n;

  /* We keep a global namespace of tags for each compilation unit.  I
     don't know if that is the right thing to do.  */

  nm = debug_add_to_namespace (info, &info->current_file->globals, name,
                            DEBUG_OBJECT_TAG, DEBUG_LINKAGE_NONE);
  if (nm == NULL)
    return DEBUG_TYPE_NULL;

  nm->u.tag = t;

  n->name = nm;

  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean debug_write ( void *  ,
const struct debug_write_fns ,
void *   
)

Definition at line 2310 of file debug.c.

{
  struct debug_handle *info = (struct debug_handle *) handle;
  struct debug_unit *u;

  /* We use a mark to tell whether we have already written out a
     particular name.  We use an integer, so that we don't have to
     clear the mark fields if we happen to write out the same
     information more than once.  */
  ++info->mark;

  /* The base_id field holds an ID value which will never be used, so
     that we can tell whether we have assigned an ID during this call
     to debug_write.  */
  info->base_id = info->class_id;

  /* We keep a linked list of classes for which was have assigned ID's
     during this call to debug_write.  */
  info->id_list = NULL;

  for (u = info->units; u != NULL; u = u->next)
    {
      struct debug_file *f;
      bfd_boolean first_file;

      info->current_write_lineno = u->linenos;
      info->current_write_lineno_index = 0;

      if (! (*fns->start_compilation_unit) (fhandle, u->files->filename))
       return FALSE;

      first_file = TRUE;
      for (f = u->files; f != NULL; f = f->next)
       {
         struct debug_name *n;

         if (first_file)
           first_file = FALSE;
         else if (! (*fns->start_source) (fhandle, f->filename))
           return FALSE;

         if (f->globals != NULL)
           for (n = f->globals->list; n != NULL; n = n->next)
             if (! debug_write_name (info, fns, fhandle, n))
              return FALSE;
       }

      /* Output any line number information which hasn't already been
         handled.  */
      if (! debug_write_linenos (info, fns, fhandle, (bfd_vma) -1))
       return FALSE;
    }

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function: