<div dir="ltr">Hi All,<div><br></div><div>I was able to read the stack map. This is my code <a href="https://github.com/KavinduZoysa/test-GCs/tree/master/statepoints">https://github.com/KavinduZoysa/test-GCs/tree/master/statepoints</a></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Kavindu Gimhan Zoysa,</div><div>BSc(Hons) | ENTC | UoM,<br></div><div dir="ltr">SSE | WSO2<div><br></div><div><a href="https://github.com/KavinduZoysa" target="_blank">GitHub</a> <a href="https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/" target="_blank">LinkedIn</a> <a href="https://medium.com/@kavindugimhanzoysa" target="_blank">Medium</a></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 13 May 2021 at 09:49, Kavindu Gimhan Zoysa <<a href="mailto:kavindu175@gmail.com">kavindu175@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Philip, <div><br></div><div>Let's say my code structure is as follows.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><i>func foo() {}<br>func bar() {<br> call foo(); // this is a statepoint<br>}<br>func readLLVMStackMap() {}<br>func main() {<br> call bar(); // this is a statepoint<br> call readLLVMStackMap();<br>}</i></blockquote><div><br></div><div>Actually, my question is that how do I read the LLVM Stack map. Simply I want to implement <b>readLLVMStackMap </b>method, in order to read the LLVM Stack Map. What is the best approach should I follow?</div><div><b><br></b></div><div>Philip, that was my question. So according to your previous answers, What I need to do is following this document <a href="https://llvm.org/docs/StackMaps.html#stack-map-section" target="_blank">https://llvm.org/docs/StackMaps.html#stack-map-section</a>. Am I right?</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Kavindu Gimhan Zoysa,</div><div>BSc(Hons) | ENTC | UoM,<br></div><div dir="ltr">SSE | WSO2<div><br></div><div><a href="https://github.com/KavinduZoysa" target="_blank">GitHub</a> <a href="https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/" target="_blank">LinkedIn</a> <a href="https://medium.com/@kavindugimhanzoysa" target="_blank">Medium</a></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 13 May 2021 at 00:14, Philip Reames <<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>This is generally the right approach, yes.</p>
<p>You may also find include/llvm/Object/StackMapParser.h helpful.</p>
<p>Philip<br>
</p>
<div>On 5/12/21 2:52 AM, Kavindu Gimhan
Zoysa wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">This is what I followed. <a href="https://stackoverflow.com/questions/8045108/use-label-in-assembly-from-c" target="_blank">https://stackoverflow.com/questions/8045108/use-label-in-assembly-from-c</a>
<div><br clear="all">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Kavindu Gimhan Zoysa,</div>
<div>BSc(Hons) | ENTC | UoM,<br>
</div>
<div dir="ltr">SSE | WSO2
<div><br>
</div>
<div><a href="https://github.com/KavinduZoysa" target="_blank">GitHub</a> <a href="https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/" target="_blank">LinkedIn</a> <a href="https://medium.com/@kavindugimhanzoysa" target="_blank">Medium</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, 12 May 2021 at 12:45,
Kavindu Gimhan Zoysa <<a href="mailto:kavindu175@gmail.com" target="_blank">kavindu175@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Hi all,</div>
<div><br>
</div>
<div>I was able to generate the Stack Map which is shown
here <a href="https://llvm.org/docs/StackMaps.html#stack-map-format" target="_blank">https://llvm.org/docs/StackMaps.html#stack-map-format</a>.
Now I want to read those entries. What I did was, I
manually change the .s file as shown below (Added the <b>.globl
__LLVM_StackMaps </b>manually). Then I can read the
entries using C code. </div>
<div><br>
</div>
<div>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-size:15px;line-height:20px;white-space:pre-wrap"><div><span style="color:rgb(86,156,214)">.globl</span> __LLVM_StackMaps </div><div><span style="color:rgb(220,220,170)">__LLVM_StackMaps:</span></div><div> <span style="color:rgb(86,156,214)">.byte</span> <span style="color:rgb(181,206,168)">3</span></div><div> <span style="color:rgb(86,156,214)">.byte</span> <span style="color:rgb(181,206,168)">0</span></div><div> <span style="color:rgb(86,156,214)">.</span>short <span style="color:rgb(181,206,168)">0</span></div></div>
</div>
<div><br>
</div>
<div>I want to know, whether this is the correct approach.
If not could you please suggest me the correct approach?</div>
<div><br>
</div>
<div>Really appreciate your input on this.</div>
<div><br>
</div>
<div>Thank you,</div>
<div>Kavindu</div>
<br clear="all">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Kavindu Gimhan Zoysa,</div>
<div>BSc(Hons) | ENTC | UoM,<br>
</div>
<div dir="ltr">SSE | WSO2
<div><br>
</div>
<div><a href="https://github.com/KavinduZoysa" target="_blank">GitHub</a> <a href="https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/" target="_blank">LinkedIn</a> <a href="https://medium.com/@kavindugimhanzoysa" target="_blank">Medium</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote></div>
</blockquote></div>