<div dir="ltr">Hi<div><br></div><div>I tried to grep the "DW_TAG_subprogram" from the debug_info . However, I noticed that the number I found is still less than the whole functions I found with LLVM IR. Do you have any experiences? Many Thanks</div><div><br></div><div>Regards</div><div>Muhui</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-02 13:34 GMT+08:00 Muhui Jiang <span dir="ltr"><<a href="mailto:jiangmuhui@gmail.com" target="_blank">jiangmuhui@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi <div><br></div><div>Actually, No particular reason. I just think this might be a solution, then I use think kind of method. Querying the symbol table would be a good choice, but I prefer to use LLVM and dwarf information. I am sorry that I am not familiar with debug_info. But thanks to your suggestions. I would like to try to solve it with debug_info. It seems work according to your comments</div><div><br></div><div>By the way, I am still curious about the reason, why dwarf line mapping table would lost so many function's start addresses' information. It would be great if you have any comments on this problem. Many Thanks</div><div><br></div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div>Muhui</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-06-01 23:00 GMT+08:00 David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Any particular reason you're using debug info to achieve this (& if you are, why you're using the line table?)? You could query the object/executable file's symbol table to find all the functions in an object or executable, and the instruction/address they start at. Or, if you are using debug info for some reason, you could look in the debug_info rather than the line table, and find the DW_TAG_subprogram for each function and look at its low_pc.</div><br><div class="gmail_quote"><div><div class="m_7785277819160323247h5"><div dir="ltr">On Fri, Jun 1, 2018 at 3:36 AM Muhui Jiang via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_7785277819160323247h5"><div dir="ltr">Hi<div><br></div><div>I am using LLVM Pass combined with dwarf debug information to get all the function's start address. My steps are below:</div><div><br></div><div>First, I write the function pass to get the start line of each function, which is finished.</div><div><br></div><div>Then, based on the start line of every single function, I try to query the specific line from the dwarf's line binary table, which is generated with llvm-dwarfdump -debug-line. </div><div><br></div><div>However, About one third of the whole functions' start line is not found in the mapping table. Thus, I can not get the start binary address. I know that the mapping between source locations and binary addresses is not bijective. I am using O1 optimization option. I know that some of the information might be lost legitimately because of optimization. But I don't think dwarf will miss so many functions' start addresses. Am I right? Any useful comments and suggestions are welcomed. Many Thanks</div><div><br></div><div>Regards</div><div>Muhui</div></div></div></div>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>