diff options
| author | Antonio Afonso <antonio.afonso@gmail.com> | 2019-06-05 16:22:33 +0000 |
|---|---|---|
| committer | Antonio Afonso <antonio.afonso@gmail.com> | 2019-06-05 16:22:33 +0000 |
| commit | 5659b36c15b0c2ad5b3ea18fcff433b15b0ffecb (patch) | |
| tree | 733dcac26a5cb9dbcbbd53ebb11ca8a6b02cfb31 /lldb/source | |
| parent | d47f5488cf02fa06259a0f8563f684e2d45165c9 (diff) | |
| download | bcm5719-llvm-5659b36c15b0c2ad5b3ea18fcff433b15b0ffecb.tar.gz bcm5719-llvm-5659b36c15b0c2ad5b3ea18fcff433b15b0ffecb.zip | |
[DynamicLoader] Make sure we always set the rendezvous breakpoint
Summary:
Once we've attached to the process we load all current modules and also set a breakpoint at the rendezvous break address.
However, we don't do this if we already have a load address for the image info address (e.g.: DT_DEBUG on ELF). This code was added 4 years ago when adding support for `$qXfer:Libraries:` packet (https://reviews.llvm.org/D9471) but its intention is not 100% clear to me. It seems to me we're using that check to know if the modules have already been loaded (which they have if `$qXfer:Libraries:` is supported by the gdb server) and skip loading the modules again in the following `if` block. The problem is that we also skip setting the Rendezvous breakpoint so we stop knowing when the process loads new modules.
I fix this by moving the call to set the breakpoint to the end of the function so we always call it as long as we have a valid executable.
Reviewers: ADodds, clayborg, eugene, labath
Reviewed By: eugene, labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62168
llvm-svn: 362619
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index 587b2d36acc..591a27f4492 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -150,11 +150,6 @@ void DynamicLoaderPOSIXDYLD::DidAttach() { true); LoadAllCurrentModules(); - if (!SetRendezvousBreakpoint()) { - // If we cannot establish rendezvous breakpoint right now we'll try again - // at entry point. - ProbeEntry(); - } m_process->GetTarget().ModulesDidLoad(module_list); if (log) { @@ -169,6 +164,14 @@ void DynamicLoaderPOSIXDYLD::DidAttach() { } } } + + if (executable_sp.get()) { + if (!SetRendezvousBreakpoint()) { + // If we cannot establish rendezvous breakpoint right now we'll try again + // at entry point. + ProbeEntry(); + } + } } void DynamicLoaderPOSIXDYLD::DidLaunch() { |

