And make cu__process_function use a real loop for the siblings, not calling
itself again like in the code pahole was initially based of.
This causes tags below DW_TAG_lexical_block tags to be discarded, will be fixed
in the next csets, with proper lex block support.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This is very hackish, see the previous cset comment, without this hack
unrelated, deeper DW_TAG_formal_parameter tags were being attributed to the
function being processed, proper fix is described in previous comment, for now
this is enough as a bandaid.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
There are cases where just a declaration is emitted, such as in
blk_rq_map_user_iov's iov parameter:
<2><dc04>: Abbrev Number: 29 (DW_TAG_structure_type)
DW_AT_name : (indirect string, offset: 0x3be8): sg_iovec
DW_AT_declaration : 1
<2><dc0a>: Abbrev Number: 88 (DW_TAG_formal_parameter)
DW_AT_name : iov
DW_AT_decl_file : 1
DW_AT_decl_line : 2472
DW_AT_type : <dc60>
DW_AT_location : 0x4288 (location list)
I.e. the DW_TAG_structure_type tag is emitted at the same level as the
DW_TAG_formal_parameter tags, so handled inside the cu__process_function
method.
This and the next cset only shows that a normalization in the parsing routines
is in real demand and will be done, normalization because what needs to be done
is similar to what is already done in places like cu__create_new_array, i.e.
process all the siblings in a level in tag specific cu methods.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Will be reused when handling DW_TAG_subprogram_type more comprehensively, in
the upcoming csets.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This reduces by 8MB the dtagnames memory footprint when processing a qemu
vmlinux, that now uses ~79MB.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
So far struct class was being used as the main data structure, switch to struct
tag, that already was the top of the tag hierarchy, being a struct class
ancestor, so reflect that and stop using struct class as the catch all class,
as a started DW_TAG_array_type tags are now represented by a new class, struct
array_type, reducing the size of struct class and reducing DW__TAG_array_type
instance memory usage.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Only needed, so far, when processing functions, have to reenable this in the
future when we got to handle it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
To load directory trees, looking for files with a specified glob mask, calling
cus__load() on the ones that match and optionally recursively searching for
more matches in subdirectories.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
So that we can extract bits from one and combine it bits from other instances,
like we'll do in ctracer, where we want to have a cus instance just to get the
kprobes definitions and forward declarations but not handle the methods in it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
For the ranges cases we store the lowest low_pc (in the first range) and the
highest high_pc (in the last range).
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Now we handle:
typedef void (dio_iodone_t)(void /* FIXME: add parm list */);
In addition to:
typedef int (*kprobe_pre_handler_t)(void /* FIXME: add parm list */);
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This is part of a cleanup process were I'm revisiting the types used for
the various abstractions, using the correct libdw.h types.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
If a definition is being emitted and there was already a forward declaration,
remove the class from the fwd_decl list before adding it to the declarations
list, in the reverse case just don't add it to the fwd_decl list.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
So that we can build a module that doesn't uses #includes to get these
definitions.
More work to be done for enums, etc, but this already is enough for
ctracer to handle tracing the sk_buff methods in vmlinux.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
In struct cus, that will be used when rebuilding class definitions for
enums, struct pointers, struct definitions, etc, in ctracer for a start.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Some rework is needed to make class_member__names and parameter__names to share
more code, but there are things like bitfields that are exclusive to
class_member entries, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>