OK here's another question along these lines: According to the LLVM source level debugging manual:<div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>

<div class="gmail_quote">The first member of subroutine (tag = DW_TAG_subroutine_type) type elements is the return type for the subroutine. The remaining elements are the formal arguments to the subroutine.</div></div></blockquote>

<div><div class="gmail_quote"><br></div><div class="gmail_quote">Now, when I read "formal arguments" I'm assuming we're talking about DIEs of type DW_TAG_formal_parameter. However, when I look in the code in CGDebugInfo.cpp in clang, I see that the arguments are in fact the bare types, not the formal parameter declarations.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Here's what my code looks like:</div><div class="gmail_quote"><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">  const ParameterList & params = type->params();</font></div></div></div><div><div class="gmail_quote">

<div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">  for (ParameterList::const_iterator it = params.begin(); it != params.end(); ++it) {</font></div></div></div><div><div class="gmail_quote">

<div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">    const ParameterDefn * param = *it;</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">    DIType ptype = genDIParameterType(param->type());</font></div>

</div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">    ptype = dbgFactory_.CreateDerivedTypeEx(</font></div></div></div><div><div class="gmail_quote">

<div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        dwarf::DW_TAG_formal_parameter,</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        dbgCompileUnit_,</font></div>

</div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        param->name() != NULL ? param->name() : "",</font></div></div>

</div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        genDIFile(param),</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote">

<font class="Apple-style-span" face="'courier new', monospace">        getSourceLineNumber(param->location()),</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        getSizeOfInBits(param->internalType()->irParameterType()),</font></div>

</div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        getInt64Val(0),</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote">

<font class="Apple-style-span" face="'courier new', monospace">        getInt64Val(0), 0,</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">        ptype);</font></div>

</div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">    DASSERT(ptype.Verify());</font></div></div></div><div><div class="gmail_quote">

<div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">    args.push_back(ptype);</font></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><font class="Apple-style-span" face="'courier new', monospace">  }</font></div>

</div></div></blockquote><div><div class="gmail_quote"><div><br></div><div>However, if I go by what's in clang, it seems that the DW_TAG_formal_parameter is unnecessary. Is this correct?</div><div><br></div><div>And I'd still like to see some of these questions addressed in the actual HTML documentation, as opposed to just responding here on the mailing list. :)</div>

<div><br></div></div><div class="gmail_quote">On Tue, Aug 31, 2010 at 10:32 AM, Devang Patel <span dir="ltr"><<a href="mailto:dpatel@apple.com">dpatel@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
On Aug 31, 2010, at 9:03 AM, Talin wrote:<br>
<br>
</div><div class="im">> 4) What is the meaning of the "inlinedAt" argument for DebugLoc::get()? Does it mean the location where the inlined code was defined, or the location where it was expanded?<br>
<br>
the location where it was expanded<br>
</div>-<br>
<font color="#888888">Devang</font></blockquote></div><br><br clear="all"><br>-- <br>-- Talin<br>
</div>