[lldb-dev] How LLDB plug-ins loaded on Windows?

Salahuddin Khan via lldb-dev lldb-dev at lists.llvm.org
Wed Jul 11 01:47:49 PDT 2018


Hi Aaron, thanks.

I'll take a look in the morning (currently 1:47am).

Just a quick question though, is this fix for lldb compiled with native PDB support or with DIA support?

As for getting the module addresses, I'm familiar with the PE image layout (having worked on the Windows Kernel team in the past and having built my own PE based OS - including a hand written x86-64 assembly PE loader from scratch) and with DIA (to some degree), so I will have a look at what's required to potentially get that working.

Thanks,
Salah

From: Aaron Smith <aaron.smith at microsoft.com>
Sent: Tuesday, July 10, 2018 10:47 PM
To: Zachary Turner <zturner at google.com>
Cc: Salahuddin Khan <sjkhan at outlook.com>; Adrian McCarthy <amccarth at google.com>; Stella Stamenova <stilis at microsoft.com>; lldb-dev at lists.llvm.org
Subject: Re: [lldb-dev] How LLDB plug-ins loaded on Windows?

Here's a more recent version of the change. It's accepted and not sure why it hasn't been committed.

https://reviews.llvm.org/D39314


________________________________
From: Zachary Turner <zturner at google.com<mailto:zturner at google.com>>
Sent: Wednesday, July 11, 2018 1:19 PM
To: Aaron Smith
Cc: Salahuddin Khan; Adrian McCarthy; Stella Stamenova; lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>
Subject: Re: [lldb-dev] How LLDB plug-ins loaded on Windows?

Is it? If lldb is totally broken without that patch we should upstream it no?
On Tue, Jul 10, 2018 at 8:52 PM Aaron Smith <aaron.smith at microsoft.com<mailto:aaron.smith at microsoft.com>> wrote:
This patch is needed for lldb to work on Windows.

https://reviews.llvm.org/D12245<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD12245&data=02%7C01%7Caaron.smith%40microsoft.com%7C50f42a2f0ed140ee6e1e08d5e6e56f1d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636668795447521815&sdata=B4bO4%2BrPD7YIEG48EstI29sYrNiQ08KTIWXR6wxb970%3D&reserved=0>


________________________________
From: Zachary Turner <zturner at google.com<mailto:zturner at google.com>>
Sent: Friday, July 6, 2018 5:17 AM
To: Salahuddin Khan
Cc: Aaron Smith; Adrian McCarthy; Stella Stamenova; lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>

Subject: Re: [lldb-dev] How LLDB plug-ins loaded on Windows?

It's been a while since i was close to this code, so adding people who have been in there more recently

On Thu, Jul 5, 2018 at 1:12 PM Salahuddin Khan <sjkhan at outlook.com<mailto:sjkhan at outlook.com>> wrote:
Hi Zachary,

Ahh ok, thanks for your quick response.

I was hoping to use LLDB on Windows (to debug Go code), which I know is DWARF based (and I thought would work on Windows), but since I couldn't seem to set a breakpoint in C/C++/Go, so I thought perhaps plug-ins weren't being loaded (although it's not possible to 'load' a .lib file, they have to be included during link time).

However, longer term I'm also hoping to replace the kernel debugger for my own operating system (a personal OS written from scratch) with LLDB. My OS uses the PE file format and has PDBs too - currently compiled on Windows using a very old version of the Windows DDK. I'm in the process of moving to a new build system using clang. I was using DIA to some degree and debugging from Windows, but I eventually hope to be able to debug one system from another also running the OS, so non-Windows support would be good.

Any idea which pieces are missing on Windows? I'm probably going to start debugging lldb to figure it out, but knowing what is needed would help significantly.

Thanks,
Salah

From: Zachary Turner <zturner at google.com<mailto:zturner at google.com>>
Sent: Thursday, July 05, 2018 12:56 PM
To: Salahuddin Khan <sjkhan at outlook.com<mailto:sjkhan at outlook.com>>
Cc: lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>
Subject: Re: [lldb-dev] How LLDB plug-ins loaded on Windows?

Plugin is a bit misleading. All "plugins" are compiled into lldb. Plugins are really just a layering abstraction.

To answer your question, pdb works currently but is limited in functionality. First, it only supports limited usage scenarios, and second it requires Windows. It's currently built on top of DIA. If you need PDB support on non Windows it will be quite a bit of work (although there's people making gradual progress on it). If you need it on Windows it basically works but you'll have to fill in some missing pieces. Several other people have been submitting patches in this area as well recently
On Thu, Jul 5, 2018 at 12:47 PM Salahuddin Khan via lldb-dev <lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>> wrote:
Hi All,

I'm somewhat puzzled by the plug-ins in LLDB, specifically on Windows.

When examining the lib directory after building LLVM/LLDB, I noticed at lot of lldbPlugin*.lib files. However, it's not clear if or how these are included in LLDB.

Here's one example:
lldbPluginSymbolFilePDB.lib

Are these compiled into lldb.exe and if so, how are they invoked? I'm trying to determine if PDB symbols are currently working, and if not, what would be required to make them work.

Thanks,
Salah
_______________________________________________
lldb-dev mailing list
lldb-dev at lists.llvm.org<mailto:lldb-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flldb-dev&data=02%7C01%7Caaron.smith%40microsoft.com%7C50f42a2f0ed140ee6e1e08d5e6e56f1d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636668795447531824&sdata=CRo2lc35gOar%2BVuPTcGk8QRpMX7Ds%2BId83chZiGHToM%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180711/4c3158aa/attachment-0001.html>


More information about the lldb-dev mailing list