Ask gdb to print the value of an expression and return the result.
(self, expr)
| 137 | return self.wait_until_ready() |
| 138 | |
| 139 | def print_value(self, expr): |
| 140 | """ |
| 141 | Ask gdb to print the value of an expression and return the result. |
| 142 | """ |
| 143 | out = self.run_command(f"p {expr}") |
| 144 | out, n = re.subn(r"^\$\d+ = ", "", out) |
| 145 | assert n == 1, out |
| 146 | # gdb may add whitespace depending on result width, remove it |
| 147 | return out.strip() |
| 148 | |
| 149 | def select_frame(self, func_name): |
| 150 | """ |
no test coverage detected