<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks Greg and Duane, I will try these things and comeback if I have further questions.<div class=""><br class=""></div><div class="">-Jiten<br class=""><div><blockquote type="cite" class=""><div class="">On Jun 7, 2016, at 12:28 PM, <a href="mailto:duane@duaneellis.com" class="">duane@duaneellis.com</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><span style="font-family: Verdana; font-size: 10pt;" class=""><div class="">You need to understand the DWARF (debug info)</div><div class=""><br class=""></div><div class="">Try this:</div><div class=""><br class=""></div><div class="">Create a *SIMPLE* C file - with a simple structure</div><div class="">Do *not* "#include" any file - make your file 100% standalone.</div><div class="">(later you can get more complicated, you want a simple translation unit)</div><div class=""><br class=""></div><div class=""><span class="">Do the following with both GCC and LLVM</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class=""></span>Compile this file using only the "-c -S"  options. (this produces an assembly listing)</div><div class=""><br class=""></div><div class="">Next, add the "-g" option thus:  "-c -S -g" - look at the difference.</div><div class="">Try other variants of the "-g" (see the man pages)</div><div class=""><br class=""></div><div class="">Look over the .S file output - this should give you a good description of the dwarf info.</div><div class=""><br class=""></div><div class="">Add things - this will get you started.  Then - start reading about DWARF records and and then start spelunking (cave exploring) through out the code base - both in LLVM and in GDB - compare and contrast.</div><div class=""><br class=""></div><div class="">Find some function - in the bowels of GDB and/or LLVM and set a breakpoint - use GDB to DEBUG GDB </div><div class="">or LLVM to Debug LLVM what ever combination you like.</div><div class=""><br class=""></div><div class="">A good example would be the "print variable" operation, then step through the code and examine the available variables and the dwarf debug data structures "in-situ" with actual data present.  Also disable the optimizer, and turn on all debugging. This means building your own version of GDB and/or LLVM </div><div class=""><br class=""></div><div class="">-Duane.</div><div class=""><br class=""></div>
<blockquote id="replyBlockquote" webmail="1" style="border-left-width: 2px; border-left-style: solid; border-left-color: blue; margin-left: 8px; padding-left: 8px; font-size: 10pt; font-family: verdana;" class="">
<div id="wmQuoteWrapper" class="">
-------- Original Message --------<br class="">
Subject: [lldb-dev] Structure variable names<br class="">
From: Jiten Thakkar via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>><br class="">
Date: Tue, June 07, 2016 9:56 am<br class="">
To: <a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">
<br class="">
Hi All,<br class="">
I am working on a project as part of my graduate study which uses LLVM.<br class="">
I am new to LLVM and lldb to be particular.<br class="">
My goal is to get names of the parameters to functions. If the parameter is a variable in a structure, it is represented as an offset in the structure.<br class="">
I want to get the names of all those parameters. I assume that debug info should provide this but so far I am unable to find any documentation regarding which would describe how to do it. <br class="">
Is there a way to do this using debug info? Is this even possible?<br class="">
Please let me know if any of this is confusing and I will try to describe it in detail.<br class="">
<br class="">
Thanks,<br class="">
Jiten<br class="">
_______________________________________________<br class="">
lldb-dev mailing list<br class="">
<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="">

</div>
</blockquote></span></div>
</div></blockquote></div><br class=""></div></body></html>