Skip to content

Commit 8ad0ae7

Browse files
sobucherhankur
authored andcommitted
testing/esp: test_appcpu_early_hw_bps without hwthread
1 parent 2af5ed7 commit 8ad0ae7

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

testing/esp/test_bp.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -316,20 +316,17 @@ def appcpu_early_hw_bps(self):
316316
self.gdb.target_reset()
317317
rsn = self.gdb.wait_target_state(dbg.TARGET_STATE_STOPPED, 10)
318318
self.add_bp('call_start_cpu1', hw=True)
319-
for target in self.oocd.targets():
320-
self.oocd.cmd_exec(f"{target} configure -rtos hwthread")
321-
self.resume_exec()
322-
self.gdb.wait_target_state(dbg.TARGET_STATE_STOPPED, 10)
323-
_,threads_info = self.gdb.get_thread_info()
319+
faddr = self.gdb.extract_exec_addr(self.gdb.data_eval_expr("&call_start_cpu1"))
320+
targets = self.oocd.targets()
324321

325322
def check_bp_hit_on_cpu(cpu_num):
326-
for ti in threads_info:
327-
if ti['name'].endswith(f".cpu{cpu_num}"):
328-
self.gdb.console_cmd_run(f"thread {ti['id']}")
329-
break
330-
frame = self.gdb.read_current_frame()
331-
self.assertEqual(frame['func'], 'call_start_cpu1')
323+
self.oocd.cmd_exec(f"targets {targets[cpu_num]}")
324+
pc = self.oocd.get_reg('pc')
325+
self.oocd.cmd_exec(f"targets {targets[0]}")
326+
self.assertEqual(pc, faddr)
332327

328+
self.resume_exec()
329+
self.gdb.wait_target_state(dbg.TARGET_STATE_STOPPED, 10)
333330
try:
334331
check_bp_hit_on_cpu(1)
335332
except:

0 commit comments

Comments
 (0)