<rdar://problem/13009943>

Added a unique integer identifier to processes. Some systems, like JTAG or other simulators, might always assign the same process ID (pid) to the processes that are being debugged. In order for scripts and the APIs to uniquely identify the processes, there needs to be another ID. Now the SBProcess class has:

uint32_t SBProcess::GetUniqueID();

This integer ID will help to truly uniquely identify a process and help with appropriate caching that can be associated with a SBProcess object.





git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172628 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 1d24e43..6c128b7 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -596,6 +596,19 @@
     return ret_val;
 }
 
+uint32_t
+SBProcess::GetUniqueID()
+{
+    uint32_t ret_val = 0;
+    ProcessSP process_sp(GetSP());
+    if (process_sp)
+        ret_val = process_sp->GetUniqueID();
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    if (log)
+        log->Printf ("SBProcess(%p)::GetUniqueID () => %" PRIu32, process_sp.get(), ret_val);
+    return ret_val;
+}
+
 ByteOrder
 SBProcess::GetByteOrder () const
 {