Where the 'if' should be just one of of the cases in the 'switch', and guess
what:
This:
diff --git a/dwarves.c b/dwarves.c
index c0ae7c8..34f29a1 100644
--- a/dwarves.c
+++ b/dwarves.c
@@ -2580,10 +2580,10 @@ static int cus__emit_typedef_definitions
}
type = cu__find_tag_by_id(cu, tdef->type);
- if (type->tag == DW_TAG_typedef)
- cus__emit_typedef_definitions(self, cu, type);
-
switch (type->tag) {
+ case DW_TAG_typedef:
+ cus__emit_typedef_definitions(self, cu, type);
+ break;
case DW_TAG_pointer_type:
ptr_type = cu__find_tag_by_id(cu, type->type);
if (ptr_type->tag != DW_TAG_subroutine_type)
Results in this:
[acme@newtoy pahole]$ codiff -V build/libdwarves.so.orig build/libdwarves.so
/home/acme/pahole/dwarves.c:
cus__emit_typedef_definitions | -18 # 466 -> 448
1 function changed, 18 bytes removed
[acme@newtoy pahole]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
tag__print on a DW_TAG_subprogram tag prints just the function prototype,
without the ending ";\", so if a user wants to print the whole function its
just a matter of calling tag__print + lexblock__(tag__function(tag), cu,
indent).
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
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>
And since there are no external users now, just unexport it, ditto
for tag__print_decl_info.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Its up to its callers, that will be moot soon as tag__print will call
function__print and as it already prints the decl info it'll be just a matter
of making all the function__print callers call tag__print instead and then
function__print will be unexported.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Thus emitting definitions/forward declarations for the types of function
pointers, not just for the return type of the function pointer.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This way cus__emit_typedef_definitions first looks for definitions in the
typedef that will be emitted, emits those definitions, then prints the typedef.
With this it'll be possible to make tag__print to print typedefs, when we know
that the definitions it needs were already previously emitted/printed.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
So that we can continue and see what was the problem, investigate using readelf
-wi and proceed to fix it, normally its just references to not yet supported
tags, so far the ones I know are not supported are DW_TAG_reference_type &
DW_TAG_namespace, i.e. tags not present in the C language, only on C++ and
other object oriented routines with such concepts.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>