OCHyams wrote:

The tangents are all good and I am also responsible there. All these features 
are connected and I've found it difficult to disentangle the parts doing 
interesting things from other stuff that's just nearby. Thanks for working it 
through and bearing with me/us.

> Why can't it reconstruct this in the face of indirect calls - if those calls 
> include DW_AT_call_target that resolves to the address of the [called 
> function]

Ah, I think you're right that would also work. I think essentially it's a 
different way to achieve the same the result. The call_target approach looks 
like it has much poorer coverage though as it can't be used if the call_target 
expressions contain volatile registers.

I've got a patch to emit `DW_AT_call_target_clobbered` when volatile regs are 
used in the expr that I'm sitting on but wanted to wait for this stuff to get 
resolved. Using that patch (on top of another that allows memory locations in 
call_target expressions), Using llvm-dwarfdump on a self-host RelWithDebInfo 
Clang build I count 113899 instances of `DW_AT_call_target_clobbered` versus 
only 2229 instances of `DW_AT_call_target` in the DWARF.

So I think in practice, most of the time we wouldn't actually be able to use 
the call_target approach as the expression is only definitely recoverable 
(because it uses no volatile registers) at < 2% of call sites.

>So this is the a() --virtual-call-> b() --tail-call-> Base::b() example above?

The example you've quoted from my last response was actually a counter-example 
I was providing against virtual_call_origin, showing a case that it doesn't 
handle brilliantly. I was intending to highlight that failure-mode is 
understood by the debugger team but they're still happy overall with the gained 
coverage.

I'm more than happy to try to cook up some examples if you'd like if you'd 
still prefer some additional clarity?

https://github.com/llvm/llvm-project/pull/167666
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to