- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
(at your option) any later version.
This program is distributed in the hope that it will be useful,
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
/* This file implements a generic debugging format. We may eventually
have readers which convert different formats into this generic
format, and writers which write it out. The initial impetus for
/* This file implements a generic debugging format. We may eventually
have readers which convert different formats into this generic
format, and writers which write it out. The initial impetus for
/* DEBUG_KIND_FUNCTION. */
struct debug_function_type *kfunction;
/* DEBUG_KIND_REFERENCE. */
/* DEBUG_KIND_FUNCTION. */
struct debug_function_type *kfunction;
/* DEBUG_KIND_REFERENCE. */
/* DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED. */
struct debug_named_type *knamed;
} u;
/* DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED. */
struct debug_named_type *knamed;
} u;
/* Visibility of the field. */
enum debug_visibility visibility;
/* Whether this is a static member. */
/* Visibility of the field. */
enum debug_visibility visibility;
/* Whether this is a static member. */
/* Visibility of the base class. */
enum debug_visibility visibility;
};
/* A method of an object. */
/* Visibility of the base class. */
enum debug_visibility visibility;
};
/* A method of an object. */
/* The visibility of the function. */
enum debug_visibility visibility;
/* Whether the function is const. */
/* The visibility of the function. */
enum debug_visibility visibility;
/* Whether the function is const. */
/* If voffset is VOFFSET_STATIC_METHOD, this is a static method. */
#define VOFFSET_STATIC_METHOD ((bfd_vma) -1)
/* Context of a virtual method function. */
/* If voffset is VOFFSET_STATIC_METHOD, this is a static method. */
#define VOFFSET_STATIC_METHOD ((bfd_vma) -1)
/* Context of a virtual method function. */
/* DEBUG_OBJECT_VARIABLE. */
struct debug_variable *variable;
/* DEBUG_OBJECT_FUNCTION. */
/* DEBUG_OBJECT_VARIABLE. */
struct debug_variable *variable;
/* DEBUG_OBJECT_FUNCTION. */
static struct debug_name *debug_add_to_current_namespace
(struct debug_handle *, const char *, enum debug_object_kind,
enum debug_object_linkage);
static struct debug_name *debug_add_to_current_namespace
(struct debug_handle *, const char *, enum debug_object_kind,
enum debug_object_linkage);
(void *, debug_type, struct debug_type_real_list *);
static bfd_boolean debug_write_name
(struct debug_handle *, const struct debug_write_fns *, void *,
struct debug_name *);
static bfd_boolean debug_write_type
(struct debug_handle *, const struct debug_write_fns *, void *,
(void *, debug_type, struct debug_type_real_list *);
static bfd_boolean debug_write_name
(struct debug_handle *, const struct debug_write_fns *, void *,
struct debug_name *);
static bfd_boolean debug_write_type
(struct debug_handle *, const struct debug_write_fns *, void *,
static bfd_boolean debug_write_class_type
(struct debug_handle *, const struct debug_write_fns *, void *,
static bfd_boolean debug_write_class_type
(struct debug_handle *, const struct debug_write_fns *, void *,
static bfd_boolean debug_write_function
(struct debug_handle *, const struct debug_write_fns *, void *,
const char *, enum debug_object_linkage, struct debug_function *);
static bfd_boolean debug_write_function
(struct debug_handle *, const struct debug_write_fns *, void *,
const char *, enum debug_object_linkage, struct debug_function *);
static bfd_boolean debug_write_linenos
(struct debug_handle *, const struct debug_write_fns *, void *, bfd_vma);
static bfd_boolean debug_set_class_id
static bfd_boolean debug_write_linenos
(struct debug_handle *, const struct debug_write_fns *, void *, bfd_vma);
static bfd_boolean debug_set_class_id
- if (f->filename[0] == name[0]
- && f->filename[1] == name[1]
- && strcmp (f->filename, name) == 0)
+ if (filename_cmp (f->filename, name) == 0)
debug_make_type (struct debug_handle *info ATTRIBUTE_UNUSED,
enum debug_type_kind kind, unsigned int size)
{
debug_make_type (struct debug_handle *info ATTRIBUTE_UNUSED,
enum debug_type_kind kind, unsigned int size)
{
debug_make_indirect_type (void *handle, debug_type *slot, const char *tag)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_indirect_type (void *handle, debug_type *slot, const char *tag)
{
struct debug_handle *info = (struct debug_handle *) handle;
struct debug_indirect_type *i;
t = debug_make_type (info, DEBUG_KIND_INDIRECT, 0);
struct debug_indirect_type *i;
t = debug_make_type (info, DEBUG_KIND_INDIRECT, 0);
debug_make_int_type (void *handle, unsigned int size, bfd_boolean unsignedp)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_int_type (void *handle, unsigned int size, bfd_boolean unsignedp)
{
struct debug_handle *info = (struct debug_handle *) handle;
struct debug_class_type *c;
t = debug_make_type (info,
struct debug_class_type *c;
t = debug_make_type (info,
struct debug_class_type *c;
t = debug_make_type (info,
struct debug_class_type *c;
t = debug_make_type (info,
struct debug_enum_type *e;
t = debug_make_type (info, DEBUG_KIND_ENUM, 0);
struct debug_enum_type *e;
t = debug_make_type (info, DEBUG_KIND_ENUM, 0);
debug_make_pointer_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_pointer_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_type *arg_types, bfd_boolean varargs)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_type *arg_types, bfd_boolean varargs)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_reference_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_reference_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
bfd_signed_vma upper, bfd_boolean stringp)
{
struct debug_handle *info = (struct debug_handle *) handle;
bfd_signed_vma upper, bfd_boolean stringp)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_set_type (void *handle, debug_type type, bfd_boolean bitstringp)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_set_type (void *handle, debug_type type, bfd_boolean bitstringp)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_const_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_const_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_volatile_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_make_volatile_type (void *handle, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_type type, bfd_vma bitpos, bfd_vma bitsize,
enum debug_visibility visibility)
{
debug_type type, bfd_vma bitpos, bfd_vma bitsize,
enum debug_visibility visibility)
{
debug_type type, const char *physname,
enum debug_visibility visibility)
{
debug_type type, const char *physname,
enum debug_visibility visibility)
{
debug_make_method (void *handle ATTRIBUTE_UNUSED, const char *name,
debug_method_variant *variants)
{
debug_make_method (void *handle ATTRIBUTE_UNUSED, const char *name,
debug_method_variant *variants)
{
bfd_boolean constp, bfd_boolean volatilep,
bfd_vma voffset, debug_type context)
{
bfd_boolean constp, bfd_boolean volatilep,
bfd_vma voffset, debug_type context)
{
enum debug_visibility visibility,
bfd_boolean constp, bfd_boolean volatilep)
{
enum debug_visibility visibility,
bfd_boolean constp, bfd_boolean volatilep)
{
debug_name_type (void *handle, const char *name, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_name_type (void *handle, const char *name, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_tag_type (void *handle, const char *name, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
debug_tag_type (void *handle, const char *name, debug_type type)
{
struct debug_handle *info = (struct debug_handle *) handle;
/* Get a base type. We build a linked list on the stack to avoid
crashing if the type is defined circularly. */
/* Get a base type. We build a linked list on the stack to avoid
crashing if the type is defined circularly. */
debug_get_real_type (void *handle, debug_type type,
struct debug_type_real_list *list)
{
debug_get_real_type (void *handle, debug_type type,
struct debug_type_real_list *list)
{
static bfd_boolean
debug_write_type (struct debug_handle *info,
const struct debug_write_fns *fns, void *fhandle,
static bfd_boolean
debug_write_type (struct debug_handle *info,
const struct debug_write_fns *fns, void *fhandle,
f = type->u.kclass->fields[i];
if (! debug_write_type (info, fns, fhandle, f->type,
f = type->u.kclass->fields[i];
if (! debug_write_type (info, fns, fhandle, f->type,
static bfd_boolean
debug_write_class_type (struct debug_handle *info,
const struct debug_write_fns *fns, void *fhandle,
static bfd_boolean
debug_write_class_type (struct debug_handle *info,
const struct debug_write_fns *fns, void *fhandle,
f = type->u.kclass->fields[i];
if (! debug_write_type (info, fns, fhandle, f->type,
f = type->u.kclass->fields[i];
if (! debug_write_type (info, fns, fhandle, f->type,
b = type->u.kclass->baseclasses[i];
if (! debug_write_type (info, fns, fhandle, b->type,
(struct debug_name *) NULL))
return FALSE;
b = type->u.kclass->baseclasses[i];
if (! debug_write_type (info, fns, fhandle, b->type,
(struct debug_name *) NULL))
return FALSE;
- if (! (*fns->class_baseclass) (fhandle, b->bitpos, b->virtual,
+ if (! (*fns->class_baseclass) (fhandle, b->bitpos, b->is_virtual,
-debug_type_samep (struct debug_handle *info, struct debug_type *t1,
- struct debug_type *t2)
+debug_type_samep (struct debug_handle *info, struct debug_type_s *t1,
+ struct debug_type_s *t2)
&& t1->u.krange->upper == t2->u.krange->upper
&& debug_type_samep (info, t1->u.krange->type,
t2->u.krange->type));
&& t1->u.krange->upper == t2->u.krange->upper
&& debug_type_samep (info, t1->u.krange->type,
t2->u.krange->type));
-debug_class_type_samep (struct debug_handle *info, struct debug_type *t1,
- struct debug_type *t2)
+debug_class_type_samep (struct debug_handle *info, struct debug_type_s *t1,
+ struct debug_type_s *t2)
for (pf1 = c1->fields, pf2 = c2->fields;
*pf1 != NULL && *pf2 != NULL;
pf1++, pf2++)
{
for (pf1 = c1->fields, pf2 = c2->fields;
*pf1 != NULL && *pf2 != NULL;
pf1++, pf2++)
{
for (pb1 = c1->baseclasses, pb2 = c2->baseclasses;
*pb1 != NULL && *pb2 != NULL;
++pb1, ++pb2)
{
for (pb1 = c1->baseclasses, pb2 = c2->baseclasses;
*pb1 != NULL && *pb2 != NULL;
++pb1, ++pb2)
{
|| b1->visibility != b2->visibility
|| ! debug_type_samep (info, b1->type, b2->type))
return FALSE;
|| b1->visibility != b2->visibility
|| ! debug_type_samep (info, b1->type, b2->type))
return FALSE;
for (pm1 = c1->methods, pm2 = c2->methods;
*pm1 != NULL && *pm2 != NULL;
++pm1, ++pm2)
{
for (pm1 = c1->methods, pm2 = c2->methods;
*pm1 != NULL && *pm2 != NULL;
++pm1, ++pm2)
{
for (pv1 = m1->variants, pv2 = m2->variants;
*pv1 != NULL && *pv2 != NULL;
++pv1, ++pv2)
{
for (pv1 = m1->variants, pv2 = m2->variants;
*pv1 != NULL && *pv2 != NULL;
++pv1, ++pv2)
{