2 "Represents a container for holding any error code.
4 For example (from test/python_api/hello_world/TestHelloWorld.py), ::
6 def hello_world_attach_with_id_api(self):
7 '''Create target, spawn a process, and attach to it by id.'''
9 target = self.dbg.CreateTarget(self.exe)
11 # Spawn a new process and don't display the stdout if not in TraceOn() mode.
13 popen = subprocess.Popen(
14 [self.exe, 'abc', 'xyz'],
15 stdout=subprocess.DEVNULL if not self.TraceOn() else None,
18 listener = lldb.SBListener('my.attach.listener')
19 error = lldb.SBError()
20 process = target.AttachToProcessWithID(listener, popen.pid, error)
22 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
24 # Let's check the stack traces of the attached process.
26 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
27 self.expect(stacktraces, exe=False,
28 substrs = ['main.c:%d' % self.line2,
31 listener = lldb.SBListener('my.attach.listener')
32 error = lldb.SBError()
33 process = target.AttachToProcessWithID(listener, popen.pid, error)
35 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
37 checks that after the attach, there is no error condition by asserting
38 that error.Success() is True and we get back a valid process object.
40 And (from test/python_api/event/TestEvent.py), ::
42 # Now launch the process, and do not stop at entry point.
43 error = lldb.SBError()
44 process = target.Launch(listener, None, None, None, None, None, None, 0, False, error)
45 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
47 checks that after calling the target.Launch() method there's no error
48 condition and we get back a void process object.") lldb
::SBError
;