[llvm-dev] How to find real heap references using LLVM Stack Map

Kavindu Gimhan Zoysa via llvm-dev llvm-dev at lists.llvm.org
Thu May 20 07:50:38 PDT 2021


Hi all,

Let's say I have an example like this


>
>
>
>
>
>
> *fn foo() {     heapRef2 = getHeapRef()     readStackMap()}fn main() {
> heapRef1 = getHeapRef()    foo();}*


When we start to read stack map in foo(), our stack has two heap references
(heapRef1 and heapRef2). From the LLVM stack map we can get the location of
*heapRef2*, using let's say rsp + offset.

But, When we consider about *heapRef1, *its' offset is given with respect
to its' function(main) rsp or rbp. But at this moment those registers are
pointed to foo()'s stack frame locations. There fore how do we get the
location of *heapRef1?*

Highly appreciate your input on this.

Thank you,
Kavindu

Kavindu Gimhan Zoysa,
BSc(Hons) | ENTC | UoM,
SSE | WSO2

GitHub <https://github.com/KavinduZoysa> LinkedIn
<https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/> Medium
<https://medium.com/@kavindugimhanzoysa>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210520/245b9219/attachment.html>


More information about the llvm-dev mailing list