Page MenuHomePhabricator

Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD
ClosedPublic

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

Details

Summary

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

Diff Detail

Repository
rLLDB LLDB

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.
source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
75

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.

102

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/llvm-lit.py -sv ~/src/lldb/lit/SymbolFile/PDB.

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