[Clang/AMDGPU] Zero sized arrays not allowed in HIP device code. (#113470)
[llvm-project.git] / lldb / test / API / functionalities / gdb_remote_client / operating_system_2.py
blob83c521781a3088aa0ca495e77a727833cfc3eda8
1 import lldb
4 class OperatingSystemPlugIn(object):
5 """Class that provides data for an instance of a LLDB 'OperatingSystemPython' plug-in class
6 This version stops once with threads 0x111 and 0x222, then stops a second time with threads
7 0x111 and 0x333."""
9 def __init__(self, process):
10 """Initialization needs a valid.SBProcess object.
12 This plug-in will get created after a live process is valid and has stopped for the first time.
13 """
14 self.process = None
15 self.registers = None
16 self.threads = None
17 self.times_called = 0
18 if isinstance(process, lldb.SBProcess) and process.IsValid():
19 self.process = process
20 self.threads = None # Will be an dictionary containing info for each thread
22 def get_target(self):
23 return self.process.target
25 def get_thread_info(self):
26 self.times_called += 1
28 if self.times_called == 1:
29 self.threads = [
31 "tid": 0x111,
32 "name": "one",
33 "queue": "queue1",
34 "state": "stopped",
35 "stop_reason": "none",
36 "core": 1,
39 "tid": 0x222,
40 "name": "two",
41 "queue": "queue2",
42 "state": "stopped",
43 "stop_reason": "none",
44 "core": 0,
47 else:
48 self.threads = [
50 "tid": 0x111,
51 "name": "one",
52 "queue": "queue1",
53 "state": "stopped",
54 "stop_reason": "none",
55 "core": 1,
58 "tid": 0x333,
59 "name": "three",
60 "queue": "queue3",
61 "state": "stopped",
62 "stop_reason": "none",
63 "core": 0,
66 return self.threads