diff options
author | Jim Ingham <jingham@apple.com> | 2011-11-01 02:46:54 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-11-01 02:46:54 +0000 |
commit | ce553d885abcce514e52618f0fd44f3c6940f171 (patch) | |
tree | 6eeb3eec23ea8d3a73cc27b1ed27f04efcc16cf3 /lldb/source/Expression/IRDynamicChecks.cpp | |
parent | fc08bdcc5761b64b0affc5ba9d7ab19812402089 (diff) | |
download | bcm5719-llvm-ce553d885abcce514e52618f0fd44f3c6940f171.tar.gz bcm5719-llvm-ce553d885abcce514e52618f0fd44f3c6940f171.zip |
Enhanced the ObjC DynamicCheckerFunction to test for "object responds to selector" as well as
"object borked"... Also made the error when the checker fails reflect this fact rather than
report a crash at 0x0.
Also a little cleanup:
- StopInfoMachException had a redundant copy of the description string.
- ThreadPlanCallFunction had a redundant copy of the thread, and had a
copy of the process that it didn't really need.
llvm-svn: 143419
Diffstat (limited to 'lldb/source/Expression/IRDynamicChecks.cpp')
-rw-r--r-- | lldb/source/Expression/IRDynamicChecks.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/Expression/IRDynamicChecks.cpp b/lldb/source/Expression/IRDynamicChecks.cpp index 17a91ee8897..1d6637dd033 100644 --- a/lldb/source/Expression/IRDynamicChecks.cpp +++ b/lldb/source/Expression/IRDynamicChecks.cpp @@ -74,6 +74,25 @@ DynamicCheckerFunctions::Install(Stream &error_stream, return true; } +bool +DynamicCheckerFunctions::DoCheckersExplainStop (lldb::addr_t addr, Stream &message) +{ + // FIXME: We have to get the checkers to know why they scotched the call in more detail, + // so we can print a better message here. + if (m_valid_pointer_check.get() != NULL && m_valid_pointer_check->ContainsAddress(addr)) + { + message.Printf ("Attempted to dereference an invalid pointer."); + return true; + } + else if (m_objc_object_check.get() != NULL && m_objc_object_check->ContainsAddress(addr)) + { + message.Printf ("Attempted to dereference an invalid ObjC Object or send it an unrecognized selector"); + return true; + } + return false; +} + + static std::string PrintValue(llvm::Value *V, bool truncate = false) { |