Will be used in the following csets, where we'll print the accessibility
info in C++ classes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
The offsets doesn't make sense, /me lazy right now to look at untangling the
expressions in the DW_AT_data_member_location.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
C++ uses this, and to cache the result of the lookup at type__name time we need
to pass the cu to class__name and type__name. Big fallout because of that :-\
But now the output is mucho embelished by the humongous strings representing
C++ templates.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Using it in the --dwarf_offset/-O new pahole command line option, useful in
debugging. Prints the tag in the dwarf offset supplied.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
So that it prints struct stats and decl info (file/line number were tags were
declared).
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
In class__fprintf, at least this can help till we get proper DW_TAG_inheritance
layout printing, that is right now blocked by lack of knowledge about
DW_AT_data_member_location DWARF expression parsing for non const expressions.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
So that in DW_TAG_inheritance we can should "virtual", "virtual public", etc.
This has yet to be supported for normal class members, constructors, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Use pdwtags, that prints all the tags, pahole has to be changed to traverse
namespaces looking for structs.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Go down the rabbit hole baby, oops, the namespace hole that is. Now we find
types inside namespaces. Off to implement namespace__fprintf so that we can see
more brunnetes and blondes out of the DWARF encoding 8)
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
For now its just the direct ancestor of struct type. But it will exists by
itself, to represent the DW_TAG_namespace DWARF tag, that is how the C++
'namespace' (and other languages too, heck, I'd love to get my hands on a
binary with DWARF info built from, say, ADA source code, objectiveC... COBOL!
:-P).
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This is in preparation for the introduction of struct namespace, that will be
struct type ancestor.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Such as types within types and class methods. This greatly improves support for
C++. Next improvements will be supporting DW_TAG_namespace and properly
supporting DW_TAG_inheritance.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Will be useful to show that the intent is to traverse just the DW_TAG_member
entries in the type list. Right now there are both DW_TAG_inheritance and
DW_TAG_member entries in the ->members type list. But there will be many more
tags, like enumerations, classes, etc, that are defined inside classes, a C++
feature. This will also help with DW_TAG_namespace support.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Fixing problems found in the fedora packaging review. There are still problems,
but lets get what works out of the door so that it gets into a distro and we
can see what is more important to work on from now on.
The OLS paper will be included as soon as it is published by the OLS organizers.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
For now only affects the --contains output.
Example showing the structs that include struct list_head in a linux kernel module:
[acme@filo pahole]$ pahole --recursive --contains list_head examples/ipv6.ko.debug.x86-64
inet_protosw
proto
sock_iocb
key_type
msg_queue
msg_msg
nf_hook_ops
softnet_data
net_device
softnet_data
dma_device
dma_client
dma_chan
class_device
net_device
softnet_data
dma_chan
class
klist_node
device_driver
device
klist
device_driver
bus_type
device
file_system_type
nfs_lock_info
file_lock
block_device
address_space
inode
dquot
mem_dqinfo
super_block
inode
signal_struct
page
kioctx
file
kiocb
work_struct
delayed_work
kioctx
timer_list
ifmcaddr6
inet6_dev
inet6_ifaddr
neigh_table
neighbour
net_device
softnet_data
sock
inet_sock
delayed_work
kioctx
plist_head
task_struct
sigpending
signal_struct
task_struct
user_struct
device
dev_pm_info
device
mutex_waiter
mutex
seq_file
block_device
quota_info
super_block
dquot
super_block
inode
zone
per_cpu_pages
free_area
kset
bus_type
subsystem
class
bus_type
__wait_queue_head
__wait_queue
rw_semaphore
quota_info
super_block
super_block
inode
key
blocking_notifier_head
bus_type
subsystem
class
bus_type
mm_struct
dentry
vm_area_struct
kobject
class_device
net_device
softnet_data
dma_chan
device_driver
module_kobject
module
device
kset
bus_type
subsystem
class
bus_type
lock_class
module
mm_struct
task_struct
Handling in multi-cu objects is not very precise, as the same struct has
different dwarf offsets (id) in each CU. A mitigation for this problem will be
provided with the --cu_list and --cu_name upcoming options, where one will be
able to get a list of the object files in a, for instance, linux kernel .ko
module and also to specify a cu name to be the only to be considered when
processing multi-cu files (again, such as .ko linux kernel modules).
This ends up being also useful to generate a reverse class hierarchy :-)
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
First user is pahole, that now has a --contains CLASS_NAME option, that will
show which classes contains CLASS_NAME, i.e.:
struct foo {
struct bar baz;
int i;
};
on an object file called with '--contains bar' will produce:
foo
if --verbose is used it will tell the number of CLASS_NAME members, so, in the
above example:
foo:1
Next thing will be a --recursive flag, that will show all the structs that
contains CLASS_NAME and the ones that contains the ones which contains and...
:-)
Useful to evaluate the impact that increasing or decreasing the size of some
important struct will have on the whole project that uses the struct.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
By default, pahole will display the offsets of the inner struct members from
the top level struct. If the user wants to focus on some inner structs, just
call the tool with the -r option to use relative offset instead of the base
offset.
Signed-off-by: Eugene Teo <eteo@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This argv munging seems gross, but nah, there are persons wanting to use codiff
on RELA architectures such as x86_64 so lets go with this for now.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cut'n'paste error, was never looking into DW_TAG_subprogram tags.
Also traverse the forest of lexblocks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
So that we can go on adding more config knobs without requiring adding new
parameters to lots of functions.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>