summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/StackFrame.cpp
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2016-09-12 05:25:33 +0000
committerIlia K <ki.stfu@gmail.com>2016-09-12 05:25:33 +0000
commit4f730dc750ab2120d8ca28728c73021bd159ac05 (patch)
treee7d01535a88d22decf7aedcbc4562eafde8f66ed /lldb/source/Target/StackFrame.cpp
parentcf6aaa9e1a81cf39c15497b2360941a7ec7d2328 (diff)
downloadbcm5719-llvm-4f730dc750ab2120d8ca28728c73021bd159ac05.tar.gz
bcm5719-llvm-4f730dc750ab2120d8ca28728c73021bd159ac05.zip
Fix about a dozen compile warnings
Summary: It fixes the following compile warnings: 1. '0' flag ignored with precision and ‘%d’ gnu_printf format 2. enumeral and non-enumeral type in conditional expression 3. format ‘%d’ expects argument of type ‘int’, but argument 4 has type ... 4. enumeration value ‘...’ not handled in switch 5. cast from type ‘const uint64_t* {aka ...}’ to type ‘int64_t* {aka ...}’ casts away qualifiers 6. extra ‘;’ 7. comparison between signed and unsigned integer expressions 8. variable ‘register_operand’ set but not used 9. control reaches end of non-void function Reviewers: jingham, emaste, zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24331 llvm-svn: 281191
Diffstat (limited to 'lldb/source/Target/StackFrame.cpp')
-rw-r--r--lldb/source/Target/StackFrame.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index 66c672e0772..0b28c1ea20e 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1278,6 +1278,8 @@ GetBaseExplainingValue(const Instruction::Operand &operand,
return std::make_pair(nullptr, 0);
}
}
+ default:
+ return std::make_pair(nullptr, 0);
}
}
@@ -1291,7 +1293,7 @@ GetBaseExplainingDereference(const Instruction::Operand &operand,
}
return std::make_pair(nullptr, 0);
}
-};
+}
lldb::ValueObjectSP StackFrame::GuessValueForAddress(lldb::addr_t addr) {
TargetSP target_sp = CalculateTarget();
@@ -1420,7 +1422,7 @@ ValueObjectSP GetValueForDereferincingOffset(StackFrame &frame,
Error error;
ValueObjectSP pointee = base->Dereference(error);
- if (offset >= pointee->GetByteSize()) {
+ if (offset >= 0 && uint64_t(offset) >= pointee->GetByteSize()) {
int64_t index = offset / pointee->GetByteSize();
offset = offset % pointee->GetByteSize();
const bool can_create = true;
@@ -1586,17 +1588,16 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
continue;
}
- Instruction::Operand *register_operand = nullptr;
Instruction::Operand *origin_operand = nullptr;
if (operands[0].m_type == Instruction::Operand::Type::Register &&
operands[0].m_clobbered == true && operands[0].m_register == reg) {
- register_operand = &operands[0];
+ // operands[0] is a register operand
origin_operand = &operands[1];
} else if (operands[1].m_type == Instruction::Operand::Type::Register &&
operands[1].m_clobbered == true &&
operands[1].m_register == reg) {
- register_operand = &operands[1];
origin_operand = &operands[0];
+ // operands[1] is a register operand
} else {
continue;
}
OpenPOWER on IntegriCloud