diff options
| author | Jim Ingham <jingham@apple.com> | 2012-10-23 21:09:09 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2012-10-23 21:09:09 +0000 |
| commit | ce0740d8cfbc3cd7e673952df1f3a0e82a95c2a6 (patch) | |
| tree | 39ec641ca33d1cd91ca92b9dffbdb8ef4c85a809 | |
| parent | 33e034a4b31959df8868e5d64df7ab274612793d (diff) | |
| download | bcm5719-llvm-ce0740d8cfbc3cd7e673952df1f3a0e82a95c2a6.tar.gz bcm5719-llvm-ce0740d8cfbc3cd7e673952df1f3a0e82a95c2a6.zip | |
Turns out there are 8 bits in a byte.
llvm-svn: 166502
| -rw-r--r-- | lldb/source/Breakpoint/Watchpoint.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp index 2012eef8785..1de33ebb24f 100644 --- a/lldb/source/Breakpoint/Watchpoint.cpp +++ b/lldb/source/Breakpoint/Watchpoint.cpp @@ -53,7 +53,7 @@ Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, size_t size, const Cl { // If we don't have a known type, then we force it to unsigned int of the right size. ClangASTContext *ast_context = target.GetScratchClangASTContext(); - clang_type_t clang_type = ast_context->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, size); + clang_type_t clang_type = ast_context->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 8 * size); m_type.SetClangType(ast_context->getASTContext(), clang_type); } @@ -141,6 +141,14 @@ Watchpoint::CaptureWatchedValue (const ExecutionContext &exe_ctx) ConstString watch_name("$__lldb__watch_value"); m_old_value_sp = m_new_value_sp; Address watch_address(GetLoadAddress()); + if (!m_type.IsValid()) + { + // Don't know how to report new & old values, since we couldn't make a scalar type for this watchpoint. + // This works around an assert in ValueObjectMemory::Create. + // FIXME: This should not happen, but if it does in some case we care about, + // we can go grab the value raw and print it as unsigned. + return false; + } m_new_value_sp = ValueObjectMemory::Create (exe_ctx.GetBestExecutionContextScope(), watch_name.AsCString(), watch_address, m_type); m_new_value_sp = m_new_value_sp->CreateConstantValue(watch_name); if (m_new_value_sp && m_new_value_sp->GetError().Success()) |

