<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>You need to understand the DWARF (debug info)</div><div><br></div><div>Try this:</div><div><br></div><div>Create a *SIMPLE* C file - with a simple structure</div><div>Do *not* "#include" any file - make your file 100% standalone.</div><div>(later you can get more complicated, you want a simple translation unit)</div><div><br></div><div><span>Do the following with both GCC and LLVM</span></div><div><span><br></span></div><div><span></span>Compile this file using only the "-c -S"  options. (this produces an assembly listing)</div><div><br></div><div>Next, add the "-g" option thus:  "-c -S -g" - look at the difference.</div><div>Try other variants of the "-g" (see the man pages)</div><div><br></div><div>Look over the .S file output - this should give you a good description of the dwarf info.</div><div><br></div><div>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><br></div><div>Find some function - in the bowels of GDB and/or LLVM and set a breakpoint - use GDB to DEBUG GDB </div><div>or LLVM to Debug LLVM what ever combination you like.</div><div><br></div><div>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><br></div><div>-Duane.</div><div><br></div>
<blockquote id="replyBlockquote" webmail="1" style="border-left: 2px solid blue; margin-left: 8px; padding-left: 8px; font-size:10pt; color:black; font-family:verdana;">
<div id="wmQuoteWrapper">
-------- Original Message --------<br>
Subject: [lldb-dev] Structure variable names<br>
From: Jiten Thakkar via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>><br>
Date: Tue, June 07, 2016 9:56 am<br>
To: <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
<br>
Hi All,<br>
I am working on a project as part of my graduate study which uses LLVM.<br>
I am new to LLVM and lldb to be particular.<br>
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>
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>
Is there a way to do this using debug info? Is this even possible?<br>
Please let me know if any of this is confusing and I will try to describe it in detail.<br>
<br>
Thanks,<br>
Jiten<br>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>

</div>
</blockquote></span></body></html>