@no_debug_info_test
def test_get_process_info(self):
    'Test SBProcess::GetProcessInfo() API with a locally launched process.'
    self.build()
    exe = self.getBuildArtifact('a.out')
    self.runCmd(('file ' + exe), CURRENT_EXECUTABLE_SET)
    target = self.dbg.CreateTarget(exe)
    self.assertTrue(target, VALID_TARGET)
    launch_info = target.GetLaunchInfo()
    launch_info.SetWorkingDirectory(self.get_process_working_directory())
    launch_flags = launch_info.GetLaunchFlags()
    launch_flags |= lldb.eLaunchFlagStopAtEntry
    launch_info.SetLaunchFlags(launch_flags)
    error = lldb.SBError()
    process = target.Launch(launch_info, error)
    if (not error.Success()):
        self.fail('Failed to launch process')
    process_info = process.GetProcessInfo()
    self.assertTrue(process_info.IsValid())
    file_spec = process_info.GetExecutableFile()
    self.assertTrue(file_spec.IsValid())
    process_name = process_info.GetName()
    self.assertIsNotNone(process_name, 'Process has a name')
    self.assertGreater(len(process_name), 0, "Process name isn't blank")
    self.assertEqual(file_spec.GetFilename(), 'a.out')
    self.assertNotEqual(process_info.GetProcessID(), lldb.LLDB_INVALID_PROCESS_ID, 'Process ID is valid')
    triple = process_info.GetTriple()
    self.assertIsNotNone(triple, 'Process has a triple')
    if process_info.UserIDIsValid():
        self.assertNotEqual(process_info.GetUserID(), lldb.UINT32_MAX, 'Process user ID is valid')
    else:
        self.assertEqual(process_info.GetUserID(), lldb.UINT32_MAX, 'Process user ID is invalid')
    if process_info.GroupIDIsValid():
        self.assertNotEqual(process_info.GetGroupID(), lldb.UINT32_MAX, 'Process group ID is valid')
    else:
        self.assertEqual(process_info.GetGroupID(), lldb.UINT32_MAX, 'Process group ID is invalid')
    if process_info.EffectiveUserIDIsValid():
        self.assertNotEqual(process_info.GetEffectiveUserID(), lldb.UINT32_MAX, 'Process effective user ID is valid')
    else:
        self.assertEqual(process_info.GetEffectiveUserID(), lldb.UINT32_MAX, 'Process effective user ID is invalid')
    if process_info.EffectiveGroupIDIsValid():
        self.assertNotEqual(process_info.GetEffectiveGroupID(), lldb.UINT32_MAX, 'Process effective group ID is valid')
    else:
        self.assertEqual(process_info.GetEffectiveGroupID(), lldb.UINT32_MAX, 'Process effective group ID is invalid')
    process_info.GetParentProcessID()
Test SBProcess::GetProcessInfo() API with a locally launched process.
@no_debug_info_test
def test_get_process_info(self):
    
    self.build()
    exe = self.getBuildArtifact('a.out')
    self.runCmd(('file ' + exe), CURRENT_EXECUTABLE_SET)
    target = self.dbg.CreateTarget(exe)
    self.assertTrue(target, VALID_TARGET)
    launch_info = target.GetLaunchInfo()
    launch_info.SetWorkingDirectory(self.get_process_working_directory())
    launch_flags = launch_info.GetLaunchFlags()
    launch_flags |= lldb.eLaunchFlagStopAtEntry
    launch_info.SetLaunchFlags(launch_flags)
    error = lldb.SBError()
    process = target.Launch(launch_info, error)
    if (not error.Success()):
        self.fail('Failed to launch process')
    process_info = process.GetProcessInfo()
    self.assertTrue(process_info.IsValid())
    file_spec = process_info.GetExecutableFile()
    self.assertTrue(file_spec.IsValid())
    process_name = process_info.GetName()
    self.assertIsNotNone(process_name, 'Process has a name')
    self.assertGreater(len(process_name), 0, "Process name isn't blank")
    self.assertEqual(file_spec.GetFilename(), 'a.out')
    self.assertNotEqual(process_info.GetProcessID(), lldb.LLDB_INVALID_PROCESS_ID, 'Process ID is valid')
    triple = process_info.GetTriple()
    self.assertIsNotNone(triple, 'Process has a triple')
    if process_info.UserIDIsValid():
        self.assertNotEqual(process_info.GetUserID(), lldb.UINT32_MAX, 'Process user ID is valid')
    else:
        self.assertEqual(process_info.GetUserID(), lldb.UINT32_MAX, 'Process user ID is invalid')
    if process_info.GroupIDIsValid():
        self.assertNotEqual(process_info.GetGroupID(), lldb.UINT32_MAX, 'Process group ID is valid')
    else:
        self.assertEqual(process_info.GetGroupID(), lldb.UINT32_MAX, 'Process group ID is invalid')
    if process_info.EffectiveUserIDIsValid():
        self.assertNotEqual(process_info.GetEffectiveUserID(), lldb.UINT32_MAX, 'Process effective user ID is valid')
    else:
        self.assertEqual(process_info.GetEffectiveUserID(), lldb.UINT32_MAX, 'Process effective user ID is invalid')
    if process_info.EffectiveGroupIDIsValid():
        self.assertNotEqual(process_info.GetEffectiveGroupID(), lldb.UINT32_MAX, 'Process effective group ID is valid')
    else:
        self.assertEqual(process_info.GetEffectiveGroupID(), lldb.UINT32_MAX, 'Process effective group ID is invalid')
    process_info.GetParentProcessID()