[lldb-dev] [LLVMdev] PDB support in LLVM
Zachary Turner
zturner at google.com
Tue Jul 21 11:02:10 PDT 2015
the lldb-mi plugin for Visual Studio they've announced only enables (afaik)
debugging of mobile devices from within Visual Studio. The code running on
these mobile devices, however, was never compiled with MSVC to begin with,
and thus does not have PDB debug information, it uses DWARF. So it's kind
of orthogonal to PDB and won't really help I think.
On Tue, Jul 21, 2015 at 9:50 AM Mukul Sabharwal <mjsabby at gmail.com> wrote:
> Should have clarified, the OP mentions in the thread that they doesn't
> specifically care about PDB generation as much as being able to use Visual
> Studio with LLDB.
>
> On Tue, Jul 21, 2015 at 9:09 AM Jim Ingham <jingham at apple.com> wrote:
>
>> I don't think MIEngine will help with support for the PDB debugging
>> format. It allows Visual Studio to use lldb to drive a Visual Studio
>> debugging session, but in this mode all the symbol & debug reading work is
>> off-loaded to lldb.
>>
>> It is possible to do a hybrid model where the low level debugger doesn't
>> do symbol reading, and some other driver tells it "what it needs to know".
>> For instance, this is the way the OS X port of MetroWerks' CodeWarrior was
>> implemented. But that was a real pain to support. There are times
>> particularly down in the bowels of the stepping machinery where you really
>> need symbol information. This never worked really well.
>>
>> Jim
>>
>>
>> > On Jul 20, 2015, at 7:03 PM, Mukul Sabharwal <mjsabby at gmail.com> wrote:
>> >
>> > FYI if you're still looking, Microsoft published the source code for
>> > the MIEngine that is essentially a Visual Studio Debugger Extension
>> > that implements the Core Debug Interfaces
>>
> > (https://msdn.microsoft.com/en-us/library/bb146305.aspx
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_bb146305.aspx&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=t_W9jgvxOWDR9CSnLXWSXrrZn8UV5Sba6KUuucScr5U&s=xhH1RKLajy9bUKUZnkhY3xjBdKkxX7UoFsRM5f-DiiE&e=>
>> )
>
>
>> >
>> > It can talk to LLDB and GDB.
>> >
>>
> > https://github.com/Microsoft/MIEngine
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Microsoft_MIEngine&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=t_W9jgvxOWDR9CSnLXWSXrrZn8UV5Sba6KUuucScr5U&s=H1rcKbTNcUUJAjXSkliS0ZWrkjsOFjS-nF8nwstvMYI&e=>
>
>
>> >
>> > On Tue, Apr 7, 2015 at 11:02 AM, Greg Clayton <gclayton at apple.com>
>> wrote:
>> >> There seems to be an DWARF to PDB converter here:
>> >>
>>
> >> https://github.com/rainers/cv2pdb
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rainers_cv2pdb&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DDUMf06MYELAe1Nlv7KChiwJLLHbYha4jtK_AOiWqwQ&m=t_W9jgvxOWDR9CSnLXWSXrrZn8UV5Sba6KUuucScr5U&s=Xts4VJNKVZfvZ6m4qZSrUZSQT6fwP2DjVAkvMWynO-g&e=>
>
>
>> >>
>> >> Not sure how good it is or what the license looks like...
>> >>
>> >>> On Apr 7, 2015, at 10:19 AM, Colin Riley <colin at codeplay.com> wrote:
>> >>>
>> >>> I think that's what I used. Hence why I want lldb C# bindings! But
>> yeah. Horridly underdocumented.
>> >>> From: Zachary Turner
>> >>> Sent: 07/04/2015 18:10
>> >>> To: Colin Riley; lldb-dev at cs.uiuc.edu
>> >>> Subject: Re: [lldb-dev] [LLVMdev] PDB support in LLVM
>> >>>
>> >>> Btw the python tools project doesn't use Dbgeng extensibility model,
>> it's a newer richer extensibility framework that is even less documented
>> (most people probably wouldn't even know it exists) but much more powerful.
>> And it's all in managed code, so you get the c# stuff for free.
>> >>>
>> >>> But still, 4-5 weeks seems very aggressive
>> >>> On Tue, Apr 7, 2015 at 9:48 AM Colin Riley <colin at codeplay.com>
>> wrote:
>> >>> You could try extending the codeview and then relying on the ms
>> linker to emit a pdb from it (last time I checked it converts on the fly -
>> this may have changed recently, and what it converts may not be fully
>> featured).
>> >>>
>> >>> The Debug Engine extensibility for visual studio is, as Zach says,
>> not well documented at all. Despite that, in the past I have had LLDB
>> chatting in a limited way to visual studio. It was incredibly messy, and
>> the way I chose to do it was go from Visual Studio -> c# -> c++/CLI -> C++
>> lldb api. Don't do it that way if you attempt it: Create lldb C# bindings
>> instead and go that direction. I've been looking at that lately but it's a
>> side project so cant be relied on if you need it quickly.
>> >>>
>> >>> As for the time frame, 4-5 weeks isn't going to get far given the
>> lack of documentation. The debug engine samples don't go far enough in
>> terms of requiring a native C++ environment.
>> >>>
>> >>> Colin
>> >>>
>> >>>
>> >>> On 07/04/2015 17:25, Zachary Turner wrote:
>> >>>> It sounds like if you have a time frame of 4-5 weeks, you've got a
>> tall order cut out for yourself. I don't want to say impossible, but...
>> that's pretty rough.
>> >>>>
>> >>>> I think you've got two options:
>> >>>> 1) Try to figure out how to emit PDB. The format is undocumented,
>> so you're kind of on your own here.
>> >>>> 2) Try to figure out how to get Visual Studio to understand DWARF.
>> Visual Studio has a reasonably rich extensibility model which is also not
>> very well documented, so you're probably on your own here as well. You may
>> want to have a look at PythonTools for Visual Studio. It's entirely open
>> source and adds Python debugging to Visual Studio. Obviously you don't
>> need to be able to debug Python, but it's the best source of documentation
>> I know of for extending Visual Studio in this kind of way so maybe it will
>> help. If you end up doing this, it would be great if you could try to
>> upstream it back to LLDB. Visual Studio integration with LLDB would be
>> nice to have.
>> >>>>
>> >>>> On Mon, Apr 6, 2015 at 5:02 PM Rohan Bajaj <rohanbajaj84 at gmail.com>
>> wrote:
>> >>>> Moving to lldb-dev per suggestion.
>> >>>>
>> >>>> Using Visual Studio is only criteria for us. It could be DWARF or
>> PDB.
>> >>>>
>> >>>> But I need to implement this soon (4-5 weeks from now). What do you
>> recommend?
>> >>>>
>> >>>> Zachary do you also suggest using LLDB on Windows?
>> >>>>
>> >>>>
>> >>>> On Mon, Apr 6, 2015 at 4:35 PM, Zachary Turner <zturner at google.com>
>> wrote:
>> >>>>
>> >>>>
>> >>>> On Mon, Apr 6, 2015 at 4:16 PM Chandler Carruth <
>> chandlerc at google.com> wrote:
>> >>>> On Mon, Apr 6, 2015 at 3:46 PM Rohan Bajaj <rohanbajaj84 at gmail.com>
>> wrote:
>> >>>> Is making PDB files for corresponding IR supported in LLVM latest
>> version?
>> >>>>
>> >>>> Not today.
>> >>>>
>> >>>>
>> >>>> After some searching I see llvm-pdbdump, but I want to annotate the
>> IR with debug information so that when I write bitcode it has pdb
>> information.
>> >>>>
>> >>>> I've heard of CodeView, but it seems to be only for line
>> information. I want variable values also.
>> >>>>
>> >>>> I would be ok to use DWARF if Visual Studio could understand it
>> using LLDB but I don't know how to do that or if it is support.
>> >>>>
>> >>>> Zach (CC-ed) and others are actively working on making LLDB work
>> well on Windows, including reading DWARF debug information on Windows and
>> potentially integration with Visual Studio (although I think that is
>> further away at the moment). However, further discussion might be better on
>> the LLDB mailing lists.
>> >>>>
>> >>>> It's worth pointing out that CodeView is **not** only for line
>> information. It's for everything. It's just that LLVM currently only
>> understands a subset of CodeView record types related to line information.
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> _______________________________________________
>> >>>> lldb-dev mailing list
>> >>>>
>> >>>> lldb-dev at cs.uiuc.edu
>> >>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>> >>>
>> >>> --
>> >>> - Colin Riley
>> >>> Senior Director,
>> >>> Parallel/Graphics Debugger Systems
>> >>>
>> >>> _______________________________________________
>> >>> lldb-dev mailing list
>> >>> lldb-dev at cs.uiuc.edu
>> >>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>> >>> _______________________________________________
>> >>> lldb-dev mailing list
>> >>> lldb-dev at cs.uiuc.edu
>> >>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>> >>
>> >>
>> >> _______________________________________________
>> >> lldb-dev mailing list
>> >> lldb-dev at cs.uiuc.edu
>> >> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>> >
>> > _______________________________________________
>> > lldb-dev mailing list
>> > lldb-dev at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150721/ca88a230/attachment.html>
More information about the lldb-dev
mailing list