restore registers
| 253 | print("Enter bthread debug mode, do not switch thread before exec 'bthread_end' !!!") |
| 254 | |
| 255 | class BthreadRegRestoreCmd(gdb.Command): |
| 256 | """restore registers""" |
| 257 | def __init__(self): |
| 258 | gdb.Command.__init__(self, "bthread_reg_restore", gdb.COMMAND_STACK, gdb.COMPLETE_NONE) |
| 259 | |
| 260 | def invoke(self, arg, tty): |
| 261 | global status |
| 262 | if not status: |
| 263 | print("Not in bthread debug mode") |
| 264 | return |
| 265 | gdb.parse_and_eval("$rip = $saved_rip") |
| 266 | gdb.parse_and_eval("$rsp = $saved_rsp") |
| 267 | gdb.parse_and_eval("$rbp = $saved_rbp") |
| 268 | print("OK") |
| 269 | |
| 270 | class BthreadEndCmd(gdb.Command): |
| 271 | """exit bthread debug mode""" |