Skip to content

Commit

Permalink
tests/esp32: flush GDB regs after monitor reset
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Jun 6, 2018
1 parent 4ed91d6 commit a9ec330
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 4 additions & 0 deletions testing/esp/debug_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def _mi_cmd_run(self, cmd, new_tgt_state=None, tmo=5):
res,res_body = self._parse_mi_resp(response, new_tgt_state)
return res,res_body

def console_cmd_run(self, cmd):
self._mi_cmd_run('-interpreter-exec console %s' % cmd)

def target_select(self, tgt_type, tgt_params):
# -target-select type parameters
res,_ = self._mi_cmd_run('-target-select %s %s' % (tgt_type, tgt_params))
Expand All @@ -225,6 +228,7 @@ def target_reset(self, action='halt'):
self.monitor_run('reset %s' % action)
if action == 'halt':
self.wait_target_state(self.TARGET_STATE_STOPPED, 5)
self.console_cmd_run('flushregs')

def target_download(self):
raise NotImplementedError('target_download')
Expand Down
8 changes: 1 addition & 7 deletions testing/esp/debug_backend_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,7 @@ def setUp(self):
self.resume_exec()
rsn = self.gdb.wait_target_state(dbg.Gdb.TARGET_STATE_STOPPED, 10)
# workarounds for strange debugger's behaviour
if rsn == dbg.Gdb.TARGET_STOP_REASON_SIGTRAP:
get_logger().warning('Unexpected SIGTRAP during setup! Apply workaround...')
cur_frame = self.gdb.get_current_frame()
self.assertEqual(cur_frame['addr'], '0x40000450')
self.resume_exec()
rsn = self.gdb.wait_target_state(dbg.Gdb.TARGET_STATE_STOPPED, 10)
elif rsn == dbg.Gdb.TARGET_STOP_REASON_SIGINT:
if rsn == dbg.Gdb.TARGET_STOP_REASON_SIGINT:
get_logger().warning('Unexpected SIGINT during setup! Apply workaround...')
cur_frame = self.gdb.get_current_frame()
# SIGINT address varies
Expand Down
1 change: 0 additions & 1 deletion testing/esp/test_bp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class DebuggerBreakpointTestsImpl:
""" Breakpoints test cases which are common for dual and single core modes
"""

@unittest.expectedFailure
def test_multi_reset_break(self):
for i in range(3):
self.gdb.target_reset()
Expand Down

0 comments on commit a9ec330

Please sign in to comment.