finally I made #gcc plugin to collect struct/classes fields & virtual methods calls cross-references, part 1: redplait.blogspot.com/2023/0…
plugin src: github.com/redplait/dwarfdum…
1
5
20
i see, for call sites i'd look at gimple instead, IMHO it's easier to find and analyze those GIMPLE_CALLs to vmethods (OBJ_TYPE_REF models the target of the call).
1
you cannot be sure that code at GIMPLE stage will be places in real native code. this is general compilers problem, llvm has it too - see for example blog.trailofbits.com/2023/07…
from OBJ_TYPE_REF you can extract types of object and called method but not name of method
1
why does DCE matter? you can just discard the information you don't need? as for the method name, you can extract the base class info from the 'this' arg type then parsing TYPE_BINFO/BINFO_VIRTUALS/etc will get you method names.
Jul 31, 2023 · 9:11 AM UTC
1

