[Lldb-commits] [PATCH] D150826: [lldb] Implement GetValueTypeFromAddressType
Augusto Noronha via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed May 17 16:49:31 PDT 2023
augusto2112 updated this revision to Diff 523219.
augusto2112 added a comment.
Add llvm_unreachable
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150826/new/
https://reviews.llvm.org/D150826
Files:
lldb/include/lldb/Core/Value.h
lldb/source/Core/Value.cpp
Index: lldb/source/Core/Value.cpp
===================================================================
--- lldb/source/Core/Value.cpp
+++ lldb/source/Core/Value.cpp
@@ -121,6 +121,20 @@
return eAddressTypeInvalid;
}
+Value::ValueType Value::GetValueTypeFromAddressType(AddressType address_type) {
+ switch (address_type) {
+ case eAddressTypeFile:
+ return Value::ValueType::FileAddress;
+ case eAddressTypeLoad:
+ return Value::ValueType::LoadAddress;
+ case eAddressTypeHost:
+ return Value::ValueType::HostAddress;
+ case eAddressTypeInvalid:
+ return Value::ValueType::Invalid;
+ }
+ llvm_unreachable("Unexpected address type!");
+}
+
RegisterInfo *Value::GetRegisterInfo() const {
if (m_context_type == ContextType::RegisterInfo)
return static_cast<RegisterInfo *>(m_context);
Index: lldb/include/lldb/Core/Value.h
===================================================================
--- lldb/include/lldb/Core/Value.h
+++ lldb/include/lldb/Core/Value.h
@@ -145,6 +145,8 @@
void Clear();
+ static ValueType GetValueTypeFromAddressType(AddressType address_type);
+
protected:
Scalar m_value;
CompilerType m_compiler_type;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150826.523219.patch
Type: text/x-patch
Size: 1189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230517/675d5b18/attachment.bin>
More information about the lldb-commits
mailing list