<div dir="ltr">On Fri, Jul 15, 2011 at 11:27, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@arm.com">renato.golin@arm.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 15 July 2011 05:35, Eli Bendersky <<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>> wrote:<br>
> Suppose one would start writing a patch to Clang to rectify this, how would<br>
> this information be encoded in the debug metadata, given the dual nature of<br>
> the arg_arr argument? Is there a mechanism to support it, or is an extension<br>
> required?<br>
<br>
</div>Hi Eli,<br>
<br>
The first thing is to make sure it actually makes any difference. I'd<br>
get an IR that is valid and can be debugged (but prints the wrong<br>
declaration) and start by changing manually the metadata in the IR<br>
until it achieves what you want (to work AND print the correct<br>
declaration). Only then I'd start changing Clang...<br>
<br>
Dwarf is too generic and debuggers' support is too ad-hoc for one to<br>
say "correct implementation". I wouldn't assume anything before seeing<br>
it working on a number of debuggers. Dwarf can be syntactically<br>
correct and not be understood by some debuggers, but it can't ever be<br>
syntactically incorrect, which I gather from your comment that it's<br>
not in your case.<br>
<br>
You can also see what other tool-chains generate from your example. It<br>
may be the quickest path to get the right answer.<font color="#888888"><br></font></blockquote><div><br>Renato, I'm not sure I understand what you mean.<br>IIUC, debug metadata in IR is the source from which DWARF is eventually generated. If the debug metatada format doesn't support such a construct (providing an alternative "type view" for a pointer), there isn't much that can be done to get this code-gened into DWARF. So I asked Devang if to his knowledge such a mechanism exists in the current debug metadata format, or could be implemented with existing fields. <br>
<br>If yes, all I need is to improve debug metadata generation from clang for this case.<br><br>If not, then perhaps an extension to the debug metadata format is required to support this.<br><br>Do you imply that DWARF doesn't support this construct, so the "cause is lost"?<br>
<br>Thanks,<br>Eli<br></div><div><br><br> </div></div><br></div>