diff options
author | Greg Clayton <gclayton@apple.com> | 2015-05-15 18:40:24 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-05-15 18:40:24 +0000 |
commit | 1548440c452b0cd0bbaf898645f0565d7e119e38 (patch) | |
tree | 3278033c3c282bf398feebabeeefbd36f45e7b4c /lldb/source/Target/Process.cpp | |
parent | 286ea2342d11a1fc00ddab83a8e1f2fe9467f333 (diff) | |
download | bcm5719-llvm-1548440c452b0cd0bbaf898645f0565d7e119e38.tar.gz bcm5719-llvm-1548440c452b0cd0bbaf898645f0565d7e119e38.zip |
OperatingSystem plug-ins need to avoid running code when fetching thread lists. This patch helps with that by making all SBValue objects that are fetched not try to do dynamic type resolution. Objective C can end up running code to fetch a list of all ISA pointers so we can tell when something is dynamic and this running code could cause the OS plug-in to continue the target.
This fix disabled dynamic types, fetches the new threads from the OS plug-in, then restores the setting.
<rdar://problem/20768407>
llvm-svn: 237465
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 1a4383eb13a..619cd4b956f 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1548,10 +1548,24 @@ Process::UpdateThreadListIfNeeded () for (size_t i=0; i<num_old_threads; ++i) old_thread_list.GetThreadAtIndex(i, false)->ClearBackingThread(); + // Turn off dynamic types to ensure we don't run any expressions. Objective C + // can run an expression to determine if a SBValue is a dynamic type or not + // and we need to avoid this. OperatingSystem plug-ins can't run expressions + // that require running code... + + Target &target = GetTarget(); + const lldb::DynamicValueType saved_prefer_dynamic = target.GetPreferDynamicValue (); + if (saved_prefer_dynamic != lldb::eNoDynamicValues) + target.SetPreferDynamicValue(lldb::eNoDynamicValues); + // Now let the OperatingSystem plug-in update the thread list + os->UpdateThreadList (old_thread_list, // Old list full of threads created by OS plug-in real_thread_list, // The actual thread list full of threads created by each lldb_private::Process subclass new_thread_list); // The new thread list that we will show to the user that gets filled in + + if (saved_prefer_dynamic != lldb::eNoDynamicValues) + target.SetPreferDynamicValue(saved_prefer_dynamic); } else { |