mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Add HighlevelFixture.pause().
This commit is contained in:
parent
964f5bb95f
commit
3a4e56e12d
2 changed files with 11 additions and 4 deletions
|
|
@ -335,6 +335,9 @@ class HighlevelFixture(object):
|
|||
def set_threads(self, *threads, **kwargs):
|
||||
return self._set_threads(threads, **kwargs)
|
||||
|
||||
def set_thread(self, thread):
|
||||
return self.set_threads(thread)[thread]
|
||||
|
||||
def _set_threads(self, threads, default_threads=True):
|
||||
request = {t[1]: t for t in threads}
|
||||
response = {t: None for t in threads}
|
||||
|
|
@ -381,6 +384,12 @@ class HighlevelFixture(object):
|
|||
self.debugger_msgs.format_frames(thread, reason, *stack),
|
||||
)
|
||||
|
||||
def pause(self, thread, *stack):
|
||||
tid = self.set_thread(thread)
|
||||
self.suspend(thread, CMD_THREAD_SUSPEND, *stack)
|
||||
self.send_request('stackTrace', {'threadId': tid})
|
||||
return tid
|
||||
|
||||
#def set_variables(self, ...):
|
||||
# ...
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ class StackTraceTests(NormalRequestTest, unittest.TestCase):
|
|||
thread = (10, 'x')
|
||||
with self.launched():
|
||||
with self.hidden():
|
||||
tid = self.set_threads(thread)[thread]
|
||||
tid = self.set_thread(thread)
|
||||
self.suspend(thread, CMD_THREAD_SUSPEND, *[
|
||||
(2, 'spam', 'abc.py', 10),
|
||||
(5, 'eggs', 'xyz.py', 2),
|
||||
|
|
@ -285,12 +285,10 @@ class ScopesTests(NormalRequestTest, unittest.TestCase):
|
|||
thread = (10, 'x')
|
||||
with self.launched():
|
||||
with self.hidden():
|
||||
tid = self.set_threads(thread)[thread]
|
||||
self.suspend(thread, CMD_THREAD_SUSPEND, *[
|
||||
self.pause(thread, *[
|
||||
(2, 'spam', 'abc.py', 10), # VSC frame ID 1
|
||||
(5, 'eggs', 'xyz.py', 2), # VSC frame ID 2
|
||||
])
|
||||
self.fix.send_request('stackTrace', {'threadId': tid})
|
||||
self.send_request(
|
||||
frameId=1,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue