<br><br><div class="gmail_quote">On Wed, Sep 12, 2012 at 9:46 AM, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Oops, I've managed to exclude the list...<br><br><br><div class="gmail_quote"><div class="im">On 12 September 2012 19:28, Nathan Jeffords <span dir="ltr"><<a href="mailto:blunted2night@gmail.com" target="_blank">blunted2night@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div>On Wed, Sep 12, 2012 at 8:50 AM, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On 12 September 2012 18:19, Nathan Jeffords <span dir="ltr"><<a href="mailto:blunted2night@gmail.com" target="_blank">blunted2night@gmail.com</a>></span> wrote:</div></div><div><div class="gmail_quote">
<div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This project seems to have some ability to convert to PDB, though it looks like the project stalled years ago...<div><br></div><div><a href="http://www.dsource.org/projects/visuald" target="_blank">http://www.dsource.org/projects/visuald</a> </div>




</blockquote><div><br></div></div><div>Years ago? Latest release was only 2 months ago.</div></div></div></blockquote><div><br></div></div><div>My mistake,  I was referring to cv2pdb which according the the web-page last had news in 2006. I had not looked in a few years. According to the repository, the project has not had a commit in three years.</div>

</div></blockquote><div><br></div></div><div>He recently added DWARF support, and serviced a couple of feature requests for me, so it's still alive. I'm sure he'd be happy to comment/help out.</div><div class="im">
<div><br></div><div>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote">I have seen mention somewhere that Microsoft's link.exe is able to extract CodeView debug info from COFF objects while linking to produce the final PDB file... maybe there's something potentially useful in there?</div>

</blockquote></div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote">


<div>cv2pdb which I mentioned above builds PDB files from both CV and DWARF info contained in final binaries (PE files at least?).</div><div><br></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div class="gmail_quote"><div><br></div><div>Is it technically possible to put debug info in MS compatible COFF objects if it behaves as you say above? How would a linker then take it and produce a PDB file at link time? And does MS link.exe not do this its self?</div>




<div>Perhaps if link.exe does actually support CV in COFF, then it's just a matter of writing CV to the objects, and using the MS linker to link and produce the PDB file?</div><div><div><br></div></div></div></div></blockquote>


</div><div><div><br></div><div>Their are a couple of options available that allow you to embed debug info directly into an object file. The /Z7 (enable old-style debug info) option does not produce a separate PDB file, presumably this generates CodeView 7 information directly into the object file. The /Yd appears to embed addition information into the object file along with generating a program database, but it gives this warning when used "option 'Yd' has been deprecated and will be removed in a future release"</div>

</div></div></blockquote><div><br></div></div><div>/Z7, that's the one. Maybe this approach can be used by LLVM? I presume LLVM is capable of producing CV info already? Maybe this configuration is already possible?</div>
<div>
It'd be interesting to try it out, CV in the COFF objects, and see if the linker makes sense of it at link time...</div><div class="im"><div><br></div></div></div></blockquote><div><br></div><div>I was able to get clang to produce COFF files with embedded DWARF debug relatively easily, which produces executables debuggable via the MinGW tool-chain. To support another debug format would be difficult I think, though I'm no expert on the subject. Currently LLVM internally represents everything more or less directly in DWARF. All of the debug meta-data attached to the IR is a slightly higher representation of DWARF data-structures. While there is a debug info builder class the insulates front ends from the details of DWARF to some extent, it is not complete isolation. I think the only feasible approach is to translate the DWARF info into CV info at a lower level, perhaps after the initial COFF object file containing DWARF has been emitted.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div class="im"><div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>I have on occasion got the inspiration to create a DWARF debug module for visual studio, then quickly go lost trying to get started. It looks like google has/is attempting to go down this road according to the pages:</div>





<div><br></div><div><a href="http://www.chromium.org/nativeclient/sdk/vsx-plugin/vsx-reference-material" target="_blank">http://www.chromium.org/nativeclient/sdk/vsx-plugin/vsx-reference-material</a></div><div><a href="http://code.google.com/p/nativeclient/wiki/NaClDebugging" target="_blank">http://code.google.com/p/nativeclient/wiki/NaClDebugging</a></div>





<div> </div><div>though a more recent page doesn't mention visual studio:</div><div><br></div><div><a href="https://developers.google.com/native-client/devguide/devcycle/debugging" target="_blank">https://developers.google.com/native-client/devguide/devcycle/debugging</a> <br>




</div></blockquote><div><br></div></div><div>It's an interesting approach, and I'd take it as a start, but it's still basically a hack. Interoperability with MSVC is non-negotiable in many windows projects.</div>



<div>
LLVM is perhaps the closest project to salvation, this is the only real limiting factor :/</div><div><div><br></div></div></div></div></blockquote><div><br></div></div><div>I would not consider this a hack. For my own use, and I'm sure others would agree, I would prefer another tool chain. I just want the productivity enhancements I get from the Visual Studio IDE. Though I agree that their are projects where MS debug information is required, due to linking against legacy code that cannot for what ever reason me compiled with a different tool chain.</div>

</div></blockquote><div><br></div></div><div>I'd also argue that the VS debugger is possibly the single biggest productivity enhancement offered by the IDE ;)</div><div>And yeah, I'm in the situation where I need to link against MSVC built code, so I need PDB at the end of the day.</div>

<div><br></div><div>Your approach would be really handy in other cases though, DWARF plugin for VisualStudio would be a generally useful tool.</div></div>
</blockquote></div><br><div>From what I was able to gather while looking into a debugger plugin, the existing user interface would drive all debuggers, thus the user should have more or less the same debugging experience with any fully implemented plugin.</div>
<div><br></div>