From 47b4f029fbb494bbefef8dcdd591850630ab93a8 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 4 Jan 2007 13:28:45 -0200 Subject: [PATCH] [CLASSES]: Handle DW_TAG_unspecified_parameters in function pointers My favourite guinea pig (linux's vmlinux) has not one pointer to a function that has unspecified parameters (...), but a new guinea pig, also a kernel, has, openbsd's kernel, example: /* /usr/home/leonardo/openbsd/src/sys/sys/protosw.h:63 */ struct protosw { short int pr_type; /* 0 2 */ void (*pr_input)(struct mbuf *, ...); /* 12 4 */ int (*pr_output)(struct mbuf *, ...); /* 16 4 */ So fix it! Signed-off-by: Arnaldo Carvalho de Melo --- classes.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/classes.c b/classes.c index bb94289..6483bd6 100644 --- a/classes.c +++ b/classes.c @@ -1943,13 +1943,18 @@ static void cu__create_new_subroutine_type(Dwarf_Die *die, struct cu *cu) do { const uint16_t tag = dwarf_tag(die); - if (tag != DW_TAG_formal_parameter) { + switch (tag) { + case DW_TAG_formal_parameter: + cu__create_new_parameter(die, ftype); + break; + case DW_TAG_unspecified_parameters: + ftype->unspec_parms = 1; + break; + default: fprintf(stderr, "%s: DW_TAG_%s not handled!\n", __FUNCTION__, dwarf_tag_name(tag)); - continue; + break; } - - cu__create_new_parameter(die, ftype); } while (dwarf_siblingof(die, die) == 0); out: cu__add_tag(cu, &ftype->tag);