[Lldb-commits] [PATCH] D150826: [lldb] Implement GetValueTypeFromAddressType

Augusto Noronha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 18 10:33:03 PDT 2023


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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150826.523442.patch
Type: text/x-patch
Size: 1189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230518/96b7c0dc/attachment.bin>


More information about the lldb-commits mailing list