[LIB]: Make typedef__print check if the type was not found

This should not happen, but right now happens as we don't support all the C++
tags, so some types are not being collected when inside DW_TAG_namespace dies.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-01-12 16:29:53 -02:00
parent 16c0586602
commit ed2d124a0e
1 changed files with 18 additions and 13 deletions

View File

@ -272,6 +272,19 @@ static struct tag *tag__new(Dwarf_Die *die)
return self;
}
static void __tag__type_not_found(const struct tag *self, const struct cu *cu,
const char *fn)
{
char bf[64];
fprintf(stderr, "%s: %#llx type not found for %s (id=%#llx)\n",
fn, self->type, dwarf_tag_name(self->tag), self->id);
fflush(stdout);
}
#define tag__type_not_found(self, cu) \
__tag__type_not_found(self, cu, __FUNCTION__)
void tag__print_decl_info(const struct tag *self)
{
printf("/* %s:%u */\n", self->decl_file, self->decl_line);
@ -321,6 +334,11 @@ static void typedef__print(const struct tag *tag_self, const struct cu *cu)
int is_pointer = 0;
char bf[512];
if (type == NULL) {
tag__type_not_found(tag_self, cu);
return;
}
switch (type->tag) {
case DW_TAG_pointer_type:
ptr_type = cu__find_tag_by_id(cu, type->type);
@ -485,19 +503,6 @@ struct tag *cu__find_tag_by_id(const struct cu *self, const Dwarf_Off id)
return NULL;
}
static void __tag__type_not_found(const struct tag *self, const struct cu *cu,
const char *fn)
{
char bf[64];
fprintf(stderr, "%s: %#llx type not found for %s (id=%#llx)\n",
fn, self->type, dwarf_tag_name(self->tag), self->id);
fflush(stdout);
}
#define tag__type_not_found(self, cu) \
__tag__type_not_found(self, cu, __FUNCTION__)
struct tag *cu__find_struct_by_name(const struct cu *self, const char *name)
{
struct tag *pos;