[lldb-dev] Creating a breakpoint on a target with no process

Zachary Turner zturner at google.com
Thu Dec 4 15:44:46 PST 2014


On Thu Dec 04 2014 at 2:35:40 PM Zachary Turner <zturner at google.com> wrote:

> On Thu Dec 04 2014 at 2:29:45 PM Greg Clayton <gclayton at apple.com> wrote:
>
>>
>> One thing you might actually need to do in the DynamicLoaderWindows is
>> find out all the shared libraries that are loaded when you attach to a
>> process. When you attach to a running process in windows, does it give you
>> a bunch of callbacks for each shared library that is already loaded? Just
>> like when you are running and a shared library loads/unloads? Or must you
>> discover them in a different way?
>>
> That's a good question and it's actually still an unknown.  There's still
> a bit more work I need to do before being able to attach to a process.  It
> might give me a module load notification for each existing module right
> when I load, and I might have to enumerate them.  Even if I have to
> enumerate them, the code to do that is pretty simple.  But it might make
> sense to put that code in the DynamicLoader::DidAttach method anyway.  For
> that matter, it might also make sense to add the main executable's module
> in DynamicLoader::DidLaunch, if nothing else for consistency.  But modules
> that load or unload while the debugger is connected seem to be a natural
> fit to just calling ModulesDidLoad.
>

Actually I checked the documentation, and it's documented
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms679295%28v=vs.85%29.aspx>
what the behavior is.  When attaching to a process, the system will
automatically send a load dll event for every currently loaded dll in the
process.  So the same code that works for creating processes will also be
able to populate the initial DLL set when attaching as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20141204/8fcb0ff8/attachment.html>


More information about the lldb-dev mailing list