Windows lldb debugging currently uses a process plugin to handle launching and attaching to a process. Launching a process via a debug server (e.g. ds2) and attaching to it with `gdb-remote port` currently doesn't communicate address information of the executable properly. Implement DynamicLoaderWindowsDYLD::DidAttach to obtain the proper address information.
Details
Diff Detail
- Build Status
Buildable 25703 Build 25702: arc lint + arc unit
Event Timeline
This fixes the broken patch from https://reviews.llvm.org/D54544
DynamicLoaderWindowsDYLD::DidLaunch is called right after ProcessWindows::DidLaunch in Process::Launch, so the previous patch was breaking the standard ProcessWindows pipeline for launching an inferior. DynamicLoaderWindowsDYLD::DidAttach is not called.
This patch's purpose is to fix debugging via
C:\> ds2 g 9021 C:\path\to\test.exe // in another terminal C:\> lldb C:\path\to\test.exe (lldb) gdb-remote 9021
The code path used for attaching to a gdb-remote on Windows is the same as used on Linux & Darwin and thus DynamicLoaderWindowsDYLD::DidAttach gets called via Process::CompleteAttach but DynamicLoaderWindowsDYLD::DidLaunch does not get called.
So to fix the previous bug the logic was moved from DidLaunch to DidAttach.
However, a test for this change can't be added without modifying the python test suite to teach it how to check for availability of ds2 and then to test with it. I toyed around with that a bit but it would require quite a few changes to lldb/packages/Python/lldbsuite/test/tools/lldb-server to be Windows compatible or just building a bunch of new infrastructure. Though I do plan on integrating ds2 into the test-suite and possibly as a tool in lldb/tools to ease the test process at some point.
@zturner I copied the win-py3-buildbot as best I could and found no regressions. Cool to land this?
Looks good if the tests pass. If something comes up (fingers crossed) we can always revert again.
@davide The review was here, not sure why this didn't get attached to the commit:
Landed in revision: https://llvm.org/svn/llvm-project/lldb/trunk@348526