summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-01-17 15:11:20 +0000
committerPavel Labath <labath@google.com>2018-01-17 15:11:20 +0000
commit555130c3f6fba87dfcf1328fca69c79def9cef3e (patch)
treebf2334ba0a8ec7283730c74795c11928f1a6ce5f
parent4652e250302443a2a112ca2c264854b94cac064c (diff)
downloadbcm5719-llvm-555130c3f6fba87dfcf1328fca69c79def9cef3e.tar.gz
bcm5719-llvm-555130c3f6fba87dfcf1328fca69c79def9cef3e.zip
[lldb][PPC64] Fixed long double variables dump
Summary: LLDB's DumpDataExtractor was not prepared to handle PowerPC's long double type: PPCDoubleDouble. As it is somewhat special, treating it as other regular float types resulted in getting wrong information about it. In this particular case, llvm::APFloat::getSizeInBits(PPCDoubleDouble) was returning 0. This caused the TestSetValues.py test to fail, because lldb would abort on an assertion failure on APInt(), because of the invalid size. Since in the PPC case the value of item_byte_size was correct and the getSizeInBits call was only added to support x87DoubleExtended semantics, this restricts the usage of getSizeInBits to the x87 semantics. Reviewers: labath, clayborg Reviewed By: labath Subscribers: llvm-commits, anajuliapc, alexandreyy, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D42083 Author: Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 322666
-rw-r--r--lldb/source/Core/DumpDataExtractor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index e564e86478f..8a175d15d88 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -583,8 +583,10 @@ lldb::offset_t lldb_private::DumpDataExtractor(
} else if (item_bit_size == ast->getTypeSize(ast->LongDoubleTy)) {
const auto &semantics =
ast->getFloatTypeSemantics(ast->LongDoubleTy);
- const auto byte_size =
- (llvm::APFloat::getSizeInBits(semantics) + 7) / 8;
+
+ offset_t byte_size = item_byte_size;
+ if (&semantics == &llvm::APFloatBase::x87DoubleExtended())
+ byte_size = (llvm::APFloat::getSizeInBits(semantics) + 7) / 8;
llvm::APInt apint;
if (GetAPInt(DE, &offset, byte_size, apint)) {
OpenPOWER on IntegriCloud