forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 use 32bit integers for threadid in protocol layer #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DonJayamanne
merged 67 commits into
microsoft:master
from
DonJayamanne:useInt32ThreadIds
Feb 12, 2018
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
ecc1ca9
Fix Microsoft/vscode#37627 (#1368)
octref 7c5778c
Version 0.7.0 of extension (#1381)
DonJayamanne 9d1bf82
Update README.md
DonJayamanne ffba179
Update README.md
DonJayamanne 905c713
sync fork with upstream
DonJayamanne acc2109
fix readme
DonJayamanne d470523
Merge branch 'master' of https://github.com/Microsoft/vscode-python
DonJayamanne d392e8b
merged upstream
DonJayamanne 92f775f
Merge remote-tracking branch 'upstream/master'
DonJayamanne 32a6e53
Merge remote-tracking branch 'upstream/master'
DonJayamanne 4b30f2c
Merge remote-tracking branch 'upstream/master'
DonJayamanne e396752
Merge remote-tracking branch 'upstream/master'
DonJayamanne eff4792
Merge remote-tracking branch 'upstream/master'
DonJayamanne 4553c28
Merge remote-tracking branch 'upstream/master'
DonJayamanne 3c6520a
Merge remote-tracking branch 'upstream/master'
DonJayamanne 966e516
Merge remote-tracking branch 'upstream/master'
DonJayamanne 63d2d65
Merge remote-tracking branch 'upstream/master'
DonJayamanne f6d469e
Merge remote-tracking branch 'upstream/master'
DonJayamanne 029e055
Merge remote-tracking branch 'upstream/master'
DonJayamanne e8c71c0
Merge remote-tracking branch 'upstream/master'
DonJayamanne 51cf9d2
Merge remote-tracking branch 'upstream/master'
DonJayamanne 7aadc43
Merge remote-tracking branch 'upstream/master'
DonJayamanne f0f5c59
Merge remote-tracking branch 'upstream/master'
DonJayamanne b2b9da9
Merge remote-tracking branch 'upstream/master'
DonJayamanne 30a4091
Merge remote-tracking branch 'upstream/master'
DonJayamanne b16d2f9
Merge remote-tracking branch 'upstream/master'
DonJayamanne c8db345
Merge remote-tracking branch 'upstream/master'
DonJayamanne 0df7f16
Merge remote-tracking branch 'upstream/master'
DonJayamanne 3ccc881
Merge remote-tracking branch 'upstream/master'
DonJayamanne bb0709e
Merge remote-tracking branch 'upstream/master'
DonJayamanne 2c19004
Merge remote-tracking branch 'upstream/master'
DonJayamanne 8f224ab
Merge remote-tracking branch 'upstream/master'
DonJayamanne 41b7080
Merge remote-tracking branch 'upstream/master'
DonJayamanne dab38dc
Merge remote-tracking branch 'upstream/master'
DonJayamanne ae22dd4
Merge remote-tracking branch 'upstream/master'
DonJayamanne d2340d2
Merge remote-tracking branch 'upstream/master'
DonJayamanne 52bb7ae
Merge remote-tracking branch 'upstream/master'
DonJayamanne b6b2531
Merge remote-tracking branch 'upstream/master'
DonJayamanne 8d8d2fc
Merge remote-tracking branch 'upstream/master'
DonJayamanne c425a55
Merge remote-tracking branch 'upstream/master'
DonJayamanne 3963217
Merge remote-tracking branch 'upstream/master'
DonJayamanne a696f2a
Merge remote-tracking branch 'upstream/master'
DonJayamanne a31e659
Merge remote-tracking branch 'upstream/master'
DonJayamanne 2663cd5
Merge remote-tracking branch 'upstream/master'
DonJayamanne 7c85e0b
Merge remote-tracking branch 'upstream/master'
DonJayamanne beb82c2
Merge remote-tracking branch 'upstream/master'
DonJayamanne 01e722a
Merge remote-tracking branch 'upstream/master'
DonJayamanne d84da8e
Merge remote-tracking branch 'upstream/master'
DonJayamanne 78da3e1
Merge remote-tracking branch 'upstream/master'
DonJayamanne 685b683
Merge remote-tracking branch 'upstream/master'
DonJayamanne 43364fd
Merge remote-tracking branch 'upstream/master'
DonJayamanne 8701636
Merge remote-tracking branch 'upstream/master'
DonJayamanne 5c8addf
Merge remote-tracking branch 'upstream/master'
DonJayamanne 588c2f9
Merge remote-tracking branch 'upstream/master'
DonJayamanne 66b1382
Merge branch 'master' of https://github.com/DonJayamanne/pythonVSCode
DonJayamanne e6b4b48
Merge remote-tracking branch 'upstream/master'
DonJayamanne 6aa9a2d
Merge remote-tracking branch 'upstream/master'
DonJayamanne 57f3982
Merge remote-tracking branch 'upstream/master'
DonJayamanne 15aab64
Merge branch 'master' of https://github.com/DonJayamanne/pythonVSCode
DonJayamanne 0e7888f
Merge remote-tracking branch 'upstream/master'
DonJayamanne 8bc4982
Merge remote-tracking branch 'upstream/master'
DonJayamanne c05d035
Merge remote-tracking branch 'upstream/master'
DonJayamanne 08476d1
Merge branch 'master' of https://github.com/DonJayamanne/pythonVSCode
DonJayamanne aeade06
Merge remote-tracking branch 'upstream/master'
DonJayamanne 6850da2
Merge branch 'master' of https://github.com/DonJayamanne/pythonVSCode
DonJayamanne 04add73
Merge remote-tracking branch 'upstream/master'
DonJayamanne 3c86fa9
:bug: use 32bit integers for threadid in protocol layer
DonJayamanne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,21 +145,21 @@ export class PythonDebugger extends LoggingDebugSession { | |
this.stopDebugServer(); | ||
} | ||
private onPythonThreadCreated(pyThread: IPythonThread) { | ||
this.sendEvent(new ThreadEvent("started", pyThread.Id)); | ||
this.sendEvent(new ThreadEvent("started", pyThread.Int32Id)); | ||
} | ||
private onStepCompleted(pyThread: IPythonThread) { | ||
this.sendEvent(new StoppedEvent("step", pyThread.Id)); | ||
this.sendEvent(new StoppedEvent("step", pyThread.Int32Id)); | ||
} | ||
private onPythonException(pyThread: IPythonThread, ex: IPythonException) { | ||
this.lastException = ex; | ||
this.sendEvent(new StoppedEvent("exception", pyThread.Id, `${ex.TypeName}, ${ex.Description}`)); | ||
this.sendEvent(new StoppedEvent("exception", pyThread.Int32Id, `${ex.TypeName}, ${ex.Description}`)); | ||
this.sendEvent(new OutputEvent(`${ex.TypeName}, ${ex.Description}\n`, "stderr")); | ||
} | ||
private onPythonThreadExited(pyThread: IPythonThread) { | ||
this.sendEvent(new ThreadEvent("exited", pyThread.Id)); | ||
this.sendEvent(new ThreadEvent("exited", pyThread.Int32Id)); | ||
} | ||
private onPythonProcessPaused(pyThread: IPythonThread) { | ||
this.sendEvent(new StoppedEvent("user request", pyThread.Id)); | ||
this.sendEvent(new StoppedEvent("user request", pyThread.Int32Id)); | ||
} | ||
private onPythonModuleLoaded(module: IPythonModule) { | ||
} | ||
|
@@ -181,7 +181,7 @@ export class PythonDebugger extends LoggingDebugSession { | |
// tslint:disable-next-line:no-non-null-assertion | ||
const thread = pyThread!; | ||
if (this.launchArgs && this.launchArgs.stopOnEntry === true) { | ||
this.sendEvent(new StoppedEvent("entry", thread.Id)); | ||
this.sendEvent(new StoppedEvent("entry", thread.Int32Id)); | ||
} else if (this.launchArgs && this.launchArgs.stopOnEntry === false) { | ||
this.configurationDone.then(() => { | ||
this.pythonProcess!.SendResumeThread(thread.Id); | ||
|
@@ -320,7 +320,7 @@ export class PythonDebugger extends LoggingDebugSession { | |
private onBreakpointHit(pyThread: IPythonThread, breakpointId: number) { | ||
// Break only if the breakpoint exists and it is enabled | ||
if (this.registeredBreakpoints.has(breakpointId) && this.registeredBreakpoints.get(breakpointId)!.Enabled === true) { | ||
this.sendEvent(new StoppedEvent("breakpoint", pyThread.Id)); | ||
this.sendEvent(new StoppedEvent("breakpoint", pyThread.Int32Id)); | ||
} | ||
else { | ||
this.pythonProcess!.SendResumeThread(pyThread.Id); | ||
|
@@ -429,7 +429,7 @@ export class PythonDebugger extends LoggingDebugSession { | |
const threads: Thread[] = []; | ||
if (this.pythonProcess) { | ||
this.pythonProcess!.Threads.forEach(t => { | ||
threads.push(new Thread(t.Id, t.Name)); | ||
threads.push(new Thread(t.Int32Id, t.Name)); | ||
}); | ||
} | ||
|
||
|
@@ -466,14 +466,13 @@ export class PythonDebugger extends LoggingDebugSession { | |
} | ||
protected stackTraceRequest(response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments): void { | ||
this.debuggerLoaded.then(() => { | ||
if (this.terminateEventSent || !this.pythonProcess || !this.pythonProcess!.Threads.has(args.threadId)) { | ||
if (this.terminateEventSent || !this.pythonProcess || Array.from(this.pythonProcess!.Threads.values()).findIndex(t => t.Int32Id === args.threadId) === -1) { | ||
response.body = { | ||
stackFrames: [] | ||
}; | ||
return this.sendResponse(response); | ||
} | ||
|
||
const pyThread = this.pythonProcess!.Threads.get(args.threadId)!; | ||
const pyThread = Array.from(this.pythonProcess!.Threads.values()).find(t => t.Int32Id === args.threadId)!; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth encapsulating search into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
let maxFrames = typeof args.levels === "number" && args.levels > 0 ? args.levels : pyThread.Frames.length - 1; | ||
maxFrames = maxFrames < pyThread.Frames.length ? maxFrames : pyThread.Frames.length; | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in
HandleThreadCreate
we are passing process toutils.CreatePythonThread
. It might be better to makeCreatePythonThread
private withinPythonProcess
since all we really do inHandleThreadCreate
is creating thread and then adding it to the process thread list. ThePythonProcess
could just do it internally. You probably wouldn't need_createdFirstThread
either then.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a related note, things like
could be encapsulated inside PythonProcess method since sequence appears to be repeated quite a bit. Moveover
appears to be used a lot too. Maybe make
getThreadFromStream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reluctant to make any changes, as all of the work would be obsolete with the new debugger work.