Add an API SBProcess::GetByteOrder() and add test cases which utilizes GetByteOrder(),
among other SBProcess APIs, to write (int)256 into a memory location of a global variable
(int)my_int and reads/checks the variable afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126792 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 3b59960..b56df41 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -366,6 +366,20 @@
     return ret_val;
 }
 
+ByteOrder
+SBProcess::GetByteOrder () const
+{
+    ByteOrder byteOrder = eByteOrderInvalid;
+    if (m_opaque_sp)
+        byteOrder = m_opaque_sp->GetTarget().GetArchitecture().GetByteOrder();
+    
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    if (log)
+        log->Printf ("SBProcess(%p)::GetByteOrder () => %d", m_opaque_sp.get(), byteOrder);
+
+    return byteOrder;
+}
+
 uint32_t
 SBProcess::GetAddressByteSize () const
 {