[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 */
<SNIP>
        void      (*pr_input)(struct mbuf *, ...); /*    12     4 */
        int       (*pr_output)(struct mbuf *, ...); /*    16     4 */
<SNIP>

So fix it!

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-01-04 13:28:45 -02:00
parent 9f3a65c7fa
commit 47b4f029fb
1 changed files with 9 additions and 4 deletions

View File

@ -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);