Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / bindings / interface / SBErrorDocstrings.i
blobb64c3d64c6c77b8a29602aa3379e02616b54fd70
1 %feature("docstring",
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.
12 import subprocess
13 popen = subprocess.Popen([self.exe, 'abc', 'xyz'],
14 stdout = open(os.devnull, 'w') if not self.TraceOn() else None)
16 listener = lldb.SBListener('my.attach.listener')
17 error = lldb.SBError()
18 process = target.AttachToProcessWithID(listener, popen.pid, error)
20 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
22 # Let's check the stack traces of the attached process.
23 import lldbutil
24 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
25 self.expect(stacktraces, exe=False,
26 substrs = ['main.c:%d' % self.line2,
27 '(int)argc=3'])
29 listener = lldb.SBListener('my.attach.listener')
30 error = lldb.SBError()
31 process = target.AttachToProcessWithID(listener, popen.pid, error)
33 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
35 checks that after the attach, there is no error condition by asserting
36 that error.Success() is True and we get back a valid process object.
38 And (from test/python_api/event/TestEvent.py), ::
40 # Now launch the process, and do not stop at entry point.
41 error = lldb.SBError()
42 process = target.Launch(listener, None, None, None, None, None, None, 0, False, error)
43 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
45 checks that after calling the target.Launch() method there's no error
46 condition and we get back a void process object.") lldb::SBError;