Page MenuHomePhabricator

Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD

Authored by lanza on Nov 14 2018, 1:53 PM.



This commit implements basic DidAttach and DidLaunch for the windows
DynamicLoader plugin which allow us to load shared libraries from the

Diff Detail


Event Timeline

lanza created this revision.Nov 14 2018, 1:53 PM
zturner accepted this revision.Nov 15 2018, 7:50 AM

Glad to see this finally getting committed, thanks!

This revision is now accepted and ready to land.Nov 15 2018, 7:50 AM
This revision was automatically updated to reflect the committed changes.
Hui added a subscriber: Hui.Nov 15 2018, 1:37 PM
Hui added inline comments.

I think DynamicLoaderWindowsDYLD::DidAttach & DidLaunch are intended for remote debugging. As the similar functionalities have been done in ProcessWindows::DidLaunch & DidAttach, the test in here is actually testing those native ones and they happen to be correct.


A remote debugging shows if the 'qFileLoadAddress' remote packet is not implemented or incorrectly handled, GetFileLoadAddress by the remote process will return error resulting base_addr stay '0. Since you are calling with the last argument 'false' to indicate it is not an offset, that will be an issue. Better to move it to line 99 and check if the load_addr is LLDB_INVALID_ADDRESS.

Moreover, if the load_addr is changed, make sure all the breakpoint address is recalculated. This feature could be a little bit complicated.

zturner added a subscriber: lanza.Nov 18 2018, 12:53 PM

I had to revert this because it breaks many tests on Windows (found by
bisecting). It was reverted in r347174.

You can reproduce one of the failures by building with this patch applied,
then doing python bin/ -sv ~/src/lldb/lit/SymbolFile/PDB.

2 of the tests should fail and you see an error about unable to read memory