From 5d2103f8061f2f535d33a5c775af322556fd3f30 Mon Sep 17 00:00:00 2001 From: Netanel Cohen Date: Thu, 6 Jun 2024 15:37:13 +0300 Subject: [PATCH] hilda_client: Add `thread` setter --- hilda/hilda_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hilda/hilda_client.py b/hilda/hilda_client.py index 58e2d41..4e1e579 100644 --- a/hilda/hilda_client.py +++ b/hilda/hilda_client.py @@ -510,7 +510,7 @@ def callback(hilda, frame, bp_loc, options): if options.get('name', False): name = options['name'] - log_message = f'🚨 #{bp.id} 0x{symbol:x} {name}' + log_message = f'🚨 #{bp.id} 0x{symbol:x} {name} - Thread #{self.thread.idx}:{hex(self.thread.id)}' if 'regs' in options: log_message += '\nregs:' @@ -895,6 +895,10 @@ def thread(self): return self._bp_frame.GetThread() return self.process.GetSelectedThread() + @thread.setter + def thread(self, idx: int): + self.process.SetSelectedThread(self.process.threads[idx - 1]) + @property def frame(self): """ Current active frame. """