[Lldb-commits] [lldb] r216867 - Add an interface on ArchSpec to provide lldb client code

Matthew Gardiner mg11 at csr.com
Mon Sep 1 02:06:04 PDT 2014


Author: mg11
Date: Mon Sep  1 04:06:03 2014
New Revision: 216867

URL: http://llvm.org/viewvc/llvm-project?rev=216867&view=rev
Log:
Add an interface on ArchSpec to provide lldb client code
with a mechanism to query if the current target architecture
has non 8-bit bytes.

Modified:
    lldb/trunk/include/lldb/Core/ArchSpec.h
    lldb/trunk/source/Core/ArchSpec.cpp

Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=216867&r1=216866&r2=216867&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Mon Sep  1 04:06:03 2014
@@ -369,6 +369,24 @@ public:
     GetMachOCPUSubType () const;
 
     //------------------------------------------------------------------
+    /// Architecture data byte width accessor
+    ///
+    /// @return the size in 8-bit (host) bytes of a minimum addressable
+    /// unit from the Architecture's data bus
+    //------------------------------------------------------------------
+    uint32_t
+    GetDataByteSize() const;
+
+    //------------------------------------------------------------------
+    /// Architecture code byte width accessor
+    ///
+    /// @return the size in 8-bit (host) bytes of a minimum addressable
+    /// unit from the Architecture's code bus
+    //------------------------------------------------------------------
+    uint32_t
+    GetCodeByteSize() const;
+ 
+    //------------------------------------------------------------------
     /// Architecture tripple accessor.
     ///
     /// @return A triple describing this ArchSpec.

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=216867&r1=216866&r2=216867&view=diff
==============================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Mon Sep  1 04:06:03 2014
@@ -497,6 +497,40 @@ ArchSpec::GetMachOCPUSubType () const
     return LLDB_INVALID_CPUTYPE;
 }
 
+uint32_t
+ArchSpec::GetDataByteSize () const
+{
+    switch (m_core)
+    {
+    case eCore_kalimba3:
+        return 3;        
+    case eCore_kalimba4:
+        return 1;        
+    case eCore_kalimba5:
+        return 3;
+    default:        
+        return 1;        
+    }
+    return 1;
+}
+
+uint32_t
+ArchSpec::GetCodeByteSize () const
+{
+    switch (m_core)
+    {
+    case eCore_kalimba3:
+        return 4;        
+    case eCore_kalimba4:
+        return 1;        
+    case eCore_kalimba5:
+        return 1;        
+    default:        
+        return 1;        
+    }
+    return 1;
+}
+
 llvm::Triple::ArchType
 ArchSpec::GetMachine () const
 {





More information about the lldb-commits mailing list