gdbcontroller
This module defines the GdbController class
which runs gdb as a subprocess and can write to it and read from it to get
structured output.
GdbController
Source code in pygdbmi/gdbcontroller.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
__init__(command=None, time_to_check_for_additional_output_sec=DEFAULT_TIME_TO_CHECK_FOR_ADDITIONAL_OUTPUT_SEC)
Run gdb as a subprocess. Send commands and receive structured output. Create new object, along with a gdb subprocess
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command |
Optional[List[str]]
|
Command to run in shell to spawn new gdb subprocess |
None
|
time_to_check_for_additional_output_sec |
float
|
When parsing responses, wait this amout of time before exiting (exits before timeout is reached to save time). If <= 0, full timeout time is used. |
DEFAULT_TIME_TO_CHECK_FOR_ADDITIONAL_OUTPUT_SEC
|
Returns:
| Type | Description |
|---|---|
None
|
New GdbController object |
Source code in pygdbmi/gdbcontroller.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
exit()
Terminate gdb process
Source code in pygdbmi/gdbcontroller.py
129 130 131 132 133 134 135 136 | |
get_gdb_response(timeout_sec=DEFAULT_GDB_TIMEOUT_SEC, raise_error_on_timeout=True)
Get gdb response. See IoManager.get_gdb_response() for details
Source code in pygdbmi/gdbcontroller.py
109 110 111 112 113 114 115 | |
spawn_new_gdb_subprocess()
Spawn a new gdb subprocess with the arguments supplied to the object during initialization. If gdb subprocess already exists, terminate it before spanwing a new one. Return int: gdb process id
Source code in pygdbmi/gdbcontroller.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
write(mi_cmd_to_write, timeout_sec=DEFAULT_GDB_TIMEOUT_SEC, raise_error_on_timeout=True, read_response=True)
Write command to gdb. See IoManager.write() for details
Source code in pygdbmi/gdbcontroller.py
117 118 119 120 121 122 123 124 125 126 127 | |