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.

llvm-svn: 126792
This commit is contained in:
Johnny Chen
2011-03-01 22:56:31 +00:00
parent 51477bd0d0
commit cf386e24ab
4 changed files with 109 additions and 0 deletions

View File

@@ -366,6 +366,20 @@ SBProcess::GetProcessID ()
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
{