Commit graph

757 commits

Author SHA1 Message Date
Fabio Zadrozny
425291ed88 sys.__breakpointhook__ should be available when __builtin__.breakpoint is set. Fixes #766 (#767)
* sys.__breakpointhook__ should be available when __builtin__.breakpoint is set. Fixes #766

* On Python 3.7, sys.__breakpointhook__ should not be tested as it'll call the original pdb version.
2018-08-27 13:21:32 -07:00
Fabio Zadrozny
ea24922b71 Fix issue launching with --nodebug. Fixes #745 (#765) 2018-08-27 13:18:12 -07:00
Karthik Nadig
c68cd7be64
Show return values (#761)
* Add show return value feature

* Add show return value tests

* Fix linter

* Check presentation hints in tests
2018-08-27 12:58:45 -07:00
Karthik Nadig
634926b6a8
Change release type from alpha to production (#759) 2018-08-22 10:54:34 -07:00
Karthik Nadig
9cb2f97990
Improve web framework test reliability (#760)
* Try setting timeouts to stabalize tests

* Fix linter issues

* Fix break into debugger

* Soem tweaks

* Give web server additional time to finish writing to output

* refactor server url extraction code

* Fix 253 builtin breakpoint (#756)

* Refactored pydevd tests.

* Add support for Python 3.7 breakpoint() function. #253

* Add tests for continue on disconnect. (#744)

* Add tests for continue on disconnect.

* Wait for optput before sending commands

* Try setting timeouts to stabalize tests

* Fix linter issues

* Fix break into debugger

* Soem tweaks

* Give web server additional time to finish writing to output

* Address comments and enable more tests

* Set timeout in disconnect test

* Fix linter

* Ensure stopped thread is breakpoint thread
2018-08-22 10:15:17 -07:00
Karthik Nadig
c84e72b325
Add tests for continue on disconnect. (#744)
* Add tests for continue on disconnect.

* Wait for optput before sending commands
2018-08-20 11:52:04 -07:00
Fabio Zadrozny
731548ac4e Fix 253 builtin breakpoint (#756)
* Refactored pydevd tests.

* Add support for Python 3.7 breakpoint() function. #253
2018-08-20 10:57:46 -07:00
Karthik Nadig
917ac6b019
Fix for server attach break into debugger (#746)
* Fix server attach break into debugger issue

* More fixes and tweaks

* Added launch module test for break_into_debugger

* Tweak allowing break_into_debugger

* Add more tests

* Switch to using CMD_GET_EXCEPTION_DETAILS (#738)

* Switch to using CMD_GET_EXCEPTION_DETAILS

* Fix exception tests

* Fix breakpoint tests

* Fix ThreadSuspendEventTests

* Fix ExceptionInfoTests

* Fix linter issue

* Some tweaks

* Fix server attach break into debugger issue

* More fixes and tweaks

* Added launch module test for break_into_debugger

* Fix linter issues
2018-08-13 14:10:23 -07:00
Karthik Nadig
b706081f23
Switch to using CMD_GET_EXCEPTION_DETAILS (#738)
* Switch to using CMD_GET_EXCEPTION_DETAILS

* Fix exception tests

* Fix breakpoint tests

* Fix ThreadSuspendEventTests

* Fix ExceptionInfoTests

* Fix linter issue

* Some tweaks
2018-08-10 21:12:19 -07:00
Karthik Nadig
2e33062f56
break_into_debugger fixes and tests (#740)
* Support break_into_debugger for launch

* Add break_into_debugger tests

* Add re-attach tests

* Fix Linter
2018-08-10 11:28:06 -07:00
Fabio Zadrozny
14515d4613 Properly add __exception__ on all frames on caught exceptions (fixes #679) (#735)
* Properly add __exception__ on all frames on caught exceptions (fixes #679)

* Provide a CMD_GET_EXCEPTION_DETAILS.
2018-08-07 14:34:50 -07:00
Karthik Nadig
f698ad8696
Add file path to sys.argv when running as module (#655)
* Add file path to sys.argv when running as module

* Bunch of fixes to set the argv[0]  correctly.

* check for pyc

* tweak __main__ py or pyc selection for argv
2018-08-07 14:08:05 -07:00
Karthik Nadig
ed565b2d05
Turning suspend all policy and using get stack trace command (#731)
* Continue resumes all threads

* Enable suspend policy ALL

* stacktraces and active exceptions are no longer stored

* stacktraces and active exceptions are no longer stored

* Fix set breakpoints tests

* Fix exception info

* Fix breakpoint tests

* Fix exception breakpoint tests

* Fix syntax

* Fix exception info

* Fix syntax

* Fix Stack trace tests

* Fix for 2.7

* Minor refactor

* Fix ContinueTests

* Fix ExceptionInfoTests

* Enable more tests

* Remove tests that are now no-ops

* Minor tweaks

* Fix test_attach_breakpoints

* typo

* More tweaks

* Send error response for unknown threads

* Use assert_contains in continue tests

* Add some TODOs
2018-08-07 11:40:33 -07:00
Karthik Nadig
bd1d1aa6b8
Uncomment some test code. (#736) 2018-08-07 10:46:06 -07:00
Karthik Nadig
e6865adac5
Remove redirect output timeout (#734) 2018-08-06 10:42:01 -07:00
Karthik Nadig
dbf3d60499
Fix for test_setup failure in python 3.7 (#733)
* Logging to find VSTS issue with test_setup

* Fix for test_setup issue

* Remove unused import
2018-08-05 11:04:59 -07:00
Fabio Zadrozny
0a773785f0 Stop showing message. #719 (#729) 2018-08-02 13:30:13 -07:00
Karthik Nadig
53e421a101
Clean up template breakpoints on detach (#713) 2018-08-02 12:43:57 -07:00
Fabio Zadrozny
46eef12aa9 Provide stack trace of uncaught exception on CMD_GET_THREAD_STACK (#697). (#710) 2018-08-01 22:01:56 -07:00
Karthik Nadig
522e9f1ce4
Fixes some bugs with just-my-code (#727)
* Continue if the suspended in debugger code

* Get more info via exception description

* More logging

* Add a check for site-packages

* Remove debug logs and cleanup

* Fix tests

* Fix more test bugs

* more cleanup
2018-08-01 19:40:34 -07:00
Don Jayamanne
f726968304
Fix blocking enable_attach and breaking on the main thread in remote debugging (#706)
Fixes #545, #711, #712 
More tests to be written as part of #718 

Summary of solution:
* For remote attach, spin up pydevd (use `install`) 
* In a separate thread wait for connections (within a loop, to support multiples)
* Ensure only one connection is supported at a time
* Use a simple event to ensure we have a single session at a time (we won't accept more than one connection if even is set)
* Use a simple event to detect when a handshake has been successfully been done

![image](https://vignette.wikia.nocookie.net/steven-universe/images/3/35/86036-victory-dance-gif-Despicable-M-EPnS.gif/revision/latest?cb=20150727031515)

@karthiknadig 
I've basically reverted the way `enable_attach` works.
This allows breaking into the current thread without any issues.
Not sure what else it breaks, lets see how the tests go.

Lets talk about the changes, hacks/solutions tomorrow.
Easy fixes, just need some simple locks!!
2018-08-01 13:00:14 -07:00
Karthik Nadig
4a4e76e6d9
Enable stop on entry feature (#702) 2018-07-31 14:52:18 -07:00
Don Jayamanne
1ec66105e1 Remove unwanted parameter and re-assigning of it (#709) 2018-07-31 12:58:24 -07:00
Karthik Nadig
c495e3749e
Fix issue with attach to remote machine (#703) 2018-07-30 15:25:13 -07:00
Fabio Zadrozny
f712369515 Provide a CMD_STOP_ON_START (#231), fix issues on path separator, refactor wait_for_breakpoint in tests. (#700) 2018-07-30 13:09:05 -07:00
Fabio Zadrozny
e5027cb5a5 Added Python 3.7 support and fixed issues related to Jython on Travis. (#692) 2018-07-28 10:25:57 -07:00
Karthik Nadig
75e53eed24
Django and Flask system test (#689)
Fixes #675 #674
* Flask system tests initial

* Enable route and template breakpoint tests.

* Fix typo

* Remove wait for thread exit

* Few more tweaks

* More tweaks

* Try adding LC_ALL utf-8

* Add more tests

* Remove flask version pinning

* Rename and move flask tests to make room for django tests

* Switch to using requests

* Fix line number in attach

* Add django to packages

* Add Django tests

* Tweaks to django test

* Remove hardcoded port
2018-07-26 15:13:59 -07:00
Fabio Zadrozny
d997742419 Fix 72 break suspension policy (#673)
* #72: Provide a way to set breakpoint suspension policy.

* Provide a CMD_GET_THREAD_STACK (#72).
2018-07-23 15:20:13 -07:00
Karthik Nadig
5db5b30ea8
Add unhandled exception tests (#682)
Adds unhandled exception tests #654
Fixes a bug in _io.py that caused JSONDecodeError in tests sometimes #683
Fixes a issue for some cases where the tests were timing out on windows
2018-07-23 13:23:04 -07:00
Don Jayamanne
501d163c5c System Tests for unhandled exceptions (#669)
* tests for unhandled exceptions

* Test source and fix linter issues
2018-07-23 10:25:10 -07:00
Karthik Nadig
bf8375830d
Update debug protocol json to latest (#676) 2018-07-18 10:31:10 -07:00
Fabio Zadrozny
f8d324a4fc #653: unhandled exceptions no longer reported twice. (#671) 2018-07-18 10:12:48 -07:00
Eric Snow
c99f884ae0
Revert "Revert "Do not wait for settrace() to finish until wait_for_attach(). (#628)" (#666)" (#670)
(helps #545)

This reverts commit 80d86b9.

Note that this still suffers from the caveat that if attach doesn't happen within a second (and wait_for_attach() isn't called) then the main thread will never have debugging enabled. One way or another that will need to be addressed.
2018-07-17 14:25:53 -06:00
Karthik Nadig
475a2d1513
Add thread count tests (#668)
* Add thread count tests

* Fix Linter

* Adding sleep to allow thread state to be captured accurately
2018-07-16 22:43:07 -07:00
Don Jayamanne
80d86b961d
Revert "Do not wait for settrace() to finish until wait_for_attach(). (#628)" (#666)
This reverts commit c816752aff.
2018-07-16 18:44:34 -07:00
Fabio Zadrozny
2edf4df6d2 #657: Fixed pydevd_file_utils dealing with .zip/.egg paths. (#660) 2018-07-16 15:44:09 -07:00
Karthik Nadig
42408e08b2
Add test with no output (#664) 2018-07-16 15:41:43 -07:00
Eric Snow
c816752aff
Do not wait for settrace() to finish until wait_for_attach(). (#628)
(helps #545)

We move the settrace() into a thread, but make sure to wait for the thread to finish in wait_for_attach().

My only concern with the solution is that the current thread will not get debugged if enable_attach() is called but wait_for_attach() is not (and no attach happens right away). I'm going to address this in a follow-up PR by monkey-patching sys.settrace temporarily.
2018-07-16 14:51:33 -06:00
Don Jayamanne
76c40c0dc0
Wait for program to run to completion to fix issue with live exception tests (#650)
Fixes #614
2018-07-13 09:42:20 -07:00
Karthik Nadig
b255ebc3a8
Update upstream metadata for debug protocol (#652) 2018-07-13 00:34:52 -07:00
Karthik Nadig
d32118074b
Fix pathutils issue with relative paths and use mixed-case test path name in test. (#647) 2018-07-12 13:28:17 -07:00
Karthik Nadig
13b7827517
Updating schema to the latest. (#651) 2018-07-12 13:27:12 -07:00
Don Jayamanne
14fdadf770
Increase connection timeouts in tests (#646)
Fixes #631
* PTVSD takes a while to load, hence having a timeout of 1.0 is not sufficient.
* Increased time to 5.0 as that'll give it plenty of time to load.
* why 5s instead of 2s, simple, why not 5s instead of 2s.
2018-07-12 10:43:03 -07:00
Don Jayamanne
3c29eeeab7
Add timeouts for thread.joins to ensure it does not block indefinitely (#644)
* Add timeouts for thread.joins (this is the main change)
* Format errors captured and displayed (for py27 and 3 compatibility)
* Format code (this accounts for 95% of the changes, was tired of linter errors, hence formatted code using autpep8)
2018-07-12 01:01:25 -07:00
Fabio Zadrozny
96cbec8522 Fixes #593: _DuplicateWriter' object has no attribute 'buffer' (#641) 2018-07-11 13:35:55 -07:00
Fabio Zadrozny
e9ed23fe75 Fixed #481: JustMyCode debugging not working in VS Code when virtualenv is inside workspace. (#640) 2018-07-11 13:35:31 -07:00
Don Jayamanne
6017f03022
Revert "Use sys.exit() instead of os.kill(). (#538)" (#634)
This reverts commit bd390322a8.
Fixes #633
Fixes #618
2018-07-11 12:58:49 -07:00
Don Jayamanne
4ab7920628
Use a unique port for system tests (#632) 2018-07-10 18:26:43 -07:00
Don Jayamanne
14982d90ba
Fix path mappings with remote debugging (#624)
Fixes #610
2018-07-10 15:09:16 -07:00
Fabio Zadrozny
2b0140e22c Fix for #620: Mix of unicode and str in filename conversion. (#621) 2018-07-10 10:35:11 -07:00