This revision was automatically updated to reflect the committed changes.
Closed by commit rG8fe9718dd5f2: [lldb] Implement GetValueTypeFromAddressType
(authored by augusto2112).
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;
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;
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits