Skip to content

Debugger does not work when another trace function is set #218

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

Closed
DonJayamanne opened this issue Nov 14, 2017 · 6 comments
Closed

Debugger does not work when another trace function is set #218

DonJayamanne opened this issue Nov 14, 2017 · 6 comments
Labels
area-debugging feature-request Request for new features or functionality

Comments

@DonJayamanne
Copy link

From @Sathisz on November 9, 2017 10:6

Environment data

VS Code version: 1.18
Python Extension version: latest
Python Version: 3.4.3
OS and version: Linux Mint 18.1

Actual behavior

No action performed

Expected behavior

Stops at the break point when it hits

Steps to reproduce:

Logs

Output from Python output panel

Output from Console window (Help->Developer Tools menu)

Copied from original issue: DonJayamanne/pythonVSCode#1377

@brettcannon brettcannon changed the title Vscode doesnot stop at break point during debugging Vscode does not stop at breakpoint during debugging Nov 14, 2017
@brettcannon brettcannon added awaiting 1-verification area-debugging bug Issue identified by VS Code Team member as probable bug labels Nov 14, 2017
@naeco2008
Copy link

Sometimes i encounter this issue as well. When i set the breakpoint on the first line, it would not stop.

@sathiz1993
Copy link

sathiz1993 commented Nov 23, 2017

I am using flask, flask have inbuild debugger so while running the flask app with debug mode in vscode , vscode debugger not working. But when I disabled flask debugger, the vscode debugger works as excepted. So the problem is when inbuild debugger is present, vscode debugger not working until we disable inbuild debugger.
I have some suggestions , If vscode debugger is on , all other debuggers present already should be disabled by vscode.

@brettcannon brettcannon added awaiting 1-decision feature-request Request for new features or functionality and removed awaiting 1-verification bug Issue identified by VS Code Team member as probable bug labels Nov 23, 2017
@brettcannon
Copy link
Member

@Sathisz ah, so you already have already called sys.settrace() indirectly via Flask. Whether we stomp on a previously set trace function is a feature enhancement that we will have to discuss as it gets complicated trying to make more than one of those work appropriately at once.

@brettcannon brettcannon changed the title Vscode does not stop at breakpoint during debugging Debugger does not work when another trace function is set Nov 23, 2017
@zubialevich
Copy link

I have a similar issue, debuger runs the code, but doesn't stops on breakpoint. I see the output in the output window, but no stops in code.
In the output window for extensions I see next message on every debug session:

attempt to send more than one response for command launch(node:6204) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'SendExceptionInfo' of null
(node:6204) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@zubialevich
Copy link

zubialevich commented Nov 30, 2017

Maybe this can also be helpful. The output from developer tools:

index.js:44 Error: TypeError: Cannot read property 'Threads' of undefined
    at PythonDebugger.threadsRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\out\client\debugger\Main.js:365:27)
    at PythonDebugger.DebugSession.dispatchRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\debugSession.js:439:22)
    at PythonDebugger.ProtocolServer._handleData (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
    at Socket.<anonymous> (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2490899
    at Object.v [as _notify] (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:63281)
    at Object.enter (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:66555)
    at n.Class.derive._oncancel._run (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67876)
    at n.Class.derive._oncancel._error (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67393)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2128430
    at _.e.dispatch (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2129781)
    at _.e.handleData (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2129289)
    at Socket.<anonymous> (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2128290)
    at emitOne (events.js:96:13)
onError @ index.js:44
(anonymous) @ index.js:110
emitOne @ events.js:96
emit @ events.js:191
window.onerror @ C:\Program Files\Microsoft VS Code\resources\electron.asar\renderer\init.js:135
i.globals.onerror @ errorTelemetry.ts:64
rawDebugSession.ts:193 Uncaught Error: TypeError: Cannot read property 'Threads' of undefined
    at PythonDebugger.threadsRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\out\client\debugger\Main.js:365:27)
    at PythonDebugger.DebugSession.dispatchRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\debugSession.js:439:22)
    at PythonDebugger.ProtocolServer._handleData (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
    at Socket.<anonymous> (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)
    at PythonDebugger.threadsRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\out\client\debugger\Main.js:365:27)
    at PythonDebugger.DebugSession.dispatchRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\debugSession.js:439:22)
    at PythonDebugger.ProtocolServer._handleData (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
    at Socket.<anonymous> (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2490899
    at Object.v [as _notify] (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:63281)
    at Object.enter (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:66555)
    at n.Class.derive._oncancel._run (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67876)
    at n.Class.derive._oncancel._error (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67393)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2128430
    at _.e.dispatch (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2129781)
    at _.e.handleData (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2129289)
    at Socket.<anonymous> (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2128290)
    at emitOne (events.js:96:13)
(anonymous) @ rawDebugSession.ts:193
v @ winjs.base.raw.js:1209
enter @ winjs.base.raw.js:901
_run @ winjs.base.raw.js:1068
_error @ winjs.base.raw.js:1041
(anonymous) @ v8Protocol.ts:53
e.dispatch @ v8Protocol.ts:136
e.handleData @ v8Protocol.ts:104
(anonymous) @ v8Protocol.ts:41
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
shell.ts:459 disposed: Error: disposed
    at e.request (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:737792)
    at Object.call (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:737675)
    at e.log (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1440690)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1442488
    at n.Class.define.cancel.then (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:69309)
    at e.publicLog (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1442362)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2490512
    at Object.v [as _notify] (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:63281)
    at Object.enter (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:66555)
    at n.Class.derive._oncancel._run (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67876)
e.onUnexpectedError @ shell.ts:459
(anonymous) @ shell.ts:419
e.onUnexpectedError @ errors.ts:119
o @ errors.ts:138
(anonymous) @ errors.ts:49
(anonymous) @ errors.ts:44
shell.ts:459 TypeError: Cannot read property 'Threads' of undefined
    at PythonDebugger.threadsRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\out\client\debugger\Main.js:365:27)
    at PythonDebugger.DebugSession.dispatchRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\debugSession.js:439:22)
    at PythonDebugger.ProtocolServer._handleData (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
    at Socket.<anonymous> (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20): Error: TypeError: Cannot read property 'Threads' of undefined
    at PythonDebugger.threadsRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\out\client\debugger\Main.js:365:27)
    at PythonDebugger.DebugSession.dispatchRequest (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\debugSession.js:439:22)
    at PythonDebugger.ProtocolServer._handleData (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
    at Socket.<anonymous> (C:\Users\Дмитрий\.vscode\extensions\ms-python.python-0.8.0\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2490899
    at Object.v [as _notify] (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:63281)
    at Object.enter (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:66555)
    at n.Class.derive._oncancel._run (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67876)
    at n.Class.derive._oncancel._error (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:67393)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2128430
    at _.e.dispatch (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2129781)
    at _.e.handleData (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2129289)
    at Socket.<anonymous> (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2128290)
    at emitOne (events.js:96:13)

@brettcannon
Copy link
Member

Closing this as it requires https://github.com/microsoft/ptvsd to support it; please request there if you still want this feature.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants