Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Turning suspend all policy and using get stack trace command #731

Merged
merged 25 commits into from
Aug 7, 2018

Conversation

karthiknadig
Copy link
Member

This change does the following:

  1. Enables the suspend all policy
  2. Pause/continue will always suspend or resume all threads
  3. Stack trace request uses CMD_GET_THREAD_STACK
  4. exception info is extracted on request.

This should address most of the concerns with #72.

@codecov-io
Copy link

Codecov Report

Merging #731 into master will decrease coverage by 0.35%.
The diff coverage is 7.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #731      +/-   ##
==========================================
- Coverage   60.39%   60.04%   -0.36%     
==========================================
  Files          27       27              
  Lines        3838     3834       -4     
==========================================
- Hits         2318     2302      -16     
- Misses       1520     1532      +12
Impacted Files Coverage Δ
ptvsd/wrapper.py 52.12% <7.27%> (-1.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a77378...0f777a3. Read the comment docs.

@karthiknadig karthiknadig changed the title WIP - NOT READY for REVIEW - Turning suspend all policy and using get stack trace command Turning suspend all policy and using get stack trace command Aug 6, 2018
Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add single pydev command to suspend all threads and resume all threads

# TODO: Replace this with resume all command after #732 is fixed
for pyd_tid in self.thread_map.pydevd_ids():
self.pydevd_notify(pydevd_comm.CMD_THREAD_RUN, pyd_tid)
self.send_response(request, allThreadsContinued=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have a single command that would tell pydevd to continue ALL threads. Feels a lot more efficient, and code world work better.

Also should be done for suspend all threads also If not already done. I.e. when we got the issue button we should send a single request to pause ALL threads instead of sending a request for each these.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For instance pause will fail if a new thread is created in the interim (a race condition resulting in a bug). So technically it should be pydeb that does the necessary plumbing and iteration of threads.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already discussed this with @fabioz see here #732. :)

# this thread are now invalid; clear their IDs.
with self.stack_traces_lock:
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌👌👌👌👌👌

@karthiknadig karthiknadig merged commit ed565b2 into microsoft:master Aug 7, 2018
@karthiknadig karthiknadig deleted the issue72 branch August 8, 2018 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants