public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* Porting pahole from dwarf_next_unit() to dwarf_get_units()
@ 2023-12-05 13:03 Dimitri John Ledkov
  2023-12-05 15:47 ` Arnaldo Carvalho de Melo
  2024-01-14 22:29 ` Mark Wielaard
  0 siblings, 2 replies; 5+ messages in thread
From: Dimitri John Ledkov @ 2023-12-05 13:03 UTC (permalink / raw)
  To: dwarves, elfutils-devel; +Cc: acme, mark

Currently pahole warns and does nothing upon hitting
DW_TAG_skeleton_unit as implemented at
https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=0135ccd632796ab3aff65b7c99b374c4682c2bcf

In elfutils, a while back a new API got added that aids with discovery
and processing of such tags -
https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=79f0e623dcde4b042bb72f636a2211d67d5c0ade

It seems to me if pahole is ported from using dwarf_next_unit() to
instead use dwarf_get_units() native support can be added for
split-dwarf (dwo) files.

I am trying to write such a port, but it is proving to be very
difficult. I am entirely unfamiliar with neither pahole nor libdw nor
the dwarf file format. Thus it is very confusing when both pahole and
dwarf library use very similar type names and structs. For example
libdw has struct Dwarf_CU and pahole has unrelated dwarf_cu struct.

What are the differences between dwarf_nextcu(), dwarf_next_unit(),
dwarf_get_units() and when should one use each one of them? (or nest
them?)

Is a port of https://git.kernel.org/pub/scm/devel/pahole/pahole.git/tree/dwarf_loader.c?id=0135ccd632796ab3aff65b7c99b374c4682c2bcf
to use dwarf_get_units() a right approach and would be welcomed?

Is anyone else interested in providing any help, or guidance?

-- 
Dimitri

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-14 22:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 13:03 Porting pahole from dwarf_next_unit() to dwarf_get_units() Dimitri John Ledkov
2023-12-05 15:47 ` Arnaldo Carvalho de Melo
2023-12-05 16:11   ` Dimitri John Ledkov
2023-12-05 18:46     ` Arnaldo Carvalho de Melo
2024-01-14 22:29 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).