Question
· Dec 30, 2022

Visual Studio Code Debugging

I am currently trying to better my development process by using Visual Studio Code because I'm more familiar and comfortable with it than Studio.

I've followed the guide here, but I'm still having issues. I initially didn't have the Web Socket protocol allowed on my Web Gateway server, but I enabled that and restarted the server with no luck.

Am I just on too old of a version? Is there any way I'd be able to use Visual Studio Code and be able to debug with what I currently have? I wish I could upgrade to IRIS, but that doesn't seem to be an option.

I am able to query processes on my server to attach to them, but after I select a processId it just loops endlessly not doing anything. I've tried debugging through a launch instead of an attach and it is the same behavior.

Any help in this matter would be greatly appreciated!

Product version: HealthShare 2017.2
$ZV: 2017.2.2 (Build 865_3_20793U)
Discussion (15)4
Log in or sign up to continue

I have followed your post and unfortunately haven't had any luck. It seems to get put into the Call Stack but nothing happens after that. Here is an image of what it currently looks like on my debug:
 

I also turned on debugging and this is the information I got in the globals:

^CacheTemp.ISC.Atelier("debug",21088) = 1
33:  ^CacheTemp.ISC.Atelier("debug",21088,1,0) = 5
34:  ^CacheTemp.ISC.Atelier("debug",21088,1,1) = "Event:init|<init appid=""AtelierDebugger"" idekey=""Atelier"" session=""21088"" thread=""1"" parent=""Cache for Windows (x86-64) 2017.2.2 (Build 865_3_20793U) Thu Apr 15 2021 16:04:37 EDT"" language=""COS"" protocol_version=""1.0"" fileuri=""file://""> <engine version=""1.0"">%Atelier.XDebugAgent</engine> <company>InterSystems Corporation</company> <license>Copyright 2015 InterSystems Corporation</license> <url>http://www.intersystems.com</url> <copyright>Copyright 2015 InterSystems Corporation</copyright></init>"
35:  ^CacheTemp.ISC.Atelier("debug",21088,1,2) = "Received:feature_get -i 1 -n stop"
36:  ^CacheTemp.ISC.Atelier("debug",21088,1,3) = "Calling state feature_get"
37:  ^CacheTemp.ISC.Atelier("debug",21088,1,4) = "Event:feature_get|<response command='feature_get' feature='stop' supported='1' transaction_id='1'></response>"
38:  ^CacheTemp.ISC.Atelier("debug",21088,1,5) = "OnClose"

Can you generate the debug log with these instructions?

Troubleshooting Debugger Issues

If you are experiencing issues using the debugger, please follow these steps before opening an issue on GitHub:

  1. Open a terminal on your server and zn to the namespace containing the class or routine you are debugging.
  2. Run the command Kill ^IRIS.Temp.Atelier("debug"), then Set ^IRIS.Temp.Atelier("debug") = 1 to turn on the Atelier API debug logging feature. If you are on Caché or Ensemble, the global is ^CacheTemp.ISC.Atelier("debug").
  3. In VS Code, start a debugging session using the configuration that produces the error.
  4. Once the error appears, copy the contents of the ^IRIS.Temp.Atelier("debug") global and add it to your GitHub issue.
  5. After you capture the log, run the command Kill ^IRIS.Temp.Atelier("debug"), then Set ^IRIS.Temp.Atelier("debug") = 0 to turn logging back off again.

Yes I can.

Here is the log from when I connect to my CSP gateway (HTTPS):

5:  ^CacheTemp.ISC.Atelier("debug",20592) = 1
6:  ^CacheTemp.ISC.Atelier("debug",20592,1,0) = 1
7:  ^CacheTemp.ISC.Atelier("debug",20592,1,1) =

"Event:init|<init appid=""AtelierDebugger"" idekey=""Atelier"" session=""20592"" thread=""1"" parent=""Cache for Windows (x86-64) 2017.2.2 (Build 865_3_20793U) Thu Apr 15 2021 16:04:37 EDT"" language=""COS"" protocol_version=""1.0"" fileuri=""file://""> <engine version=""1.0"">%Atelier.XDebugAgent</engine> <company>InterSystems Corporation</company> <license>Copyright 2015 InterSystems Corporation</license> <url>http://www.intersystems.com</url> <copyright>Copyright 2015 InterSystems Corporation</copyright></init>"

Here is when I do it when I connect directly to the server through port 57772:

8:  ^CacheTemp.ISC.Atelier("debug",21036) = 1
9:  ^CacheTemp.ISC.Atelier("debug",21036,1,0) = 77
10:  ^CacheTemp.ISC.Atelier("debug",21036,1,1) = "Event:init|<init appid=""AtelierDebugger"" idekey=""Atelier"" session=""21036"" thread=""1"" parent=""Cache for Windows (x86-64) 2017.2.2 (Build 865_3_20793U) Thu Apr 15 2021 16:04:37 EDT"" language=""COS"" protocol_version=""1.0"" fileuri=""file://""> <engine version=""1.0"">%Atelier.XDebugAgent</engine> <company>InterSystems Corporation</company> <license>Copyright 2015 InterSystems Corporation</license> <url>http://www.intersystems.com</url> <copyright>Copyright 2015 InterSystems Corporation</copyright></init>"
11:  ^CacheTemp.ISC.Atelier("debug",21036,1,2) = "Received:feature_set -i 1 -n max_data -v 8192"
12:  ^CacheTemp.ISC.Atelier("debug",21036,1,3) = "Calling state feature_set"
13:  ^CacheTemp.ISC.Atelier("debug",21036,1,4) = "Event:feature_set|<response command='feature_set' feature='max_data' success='1' transaction_id='1'/>"
14:  ^CacheTemp.ISC.Atelier("debug",21036,1,5) = "Received:feature_set -i 2 -n max_children -v 32"
15:  ^CacheTemp.ISC.Atelier("debug",21036,1,6) = "Calling state feature_set"
16:  ^CacheTemp.ISC.Atelier("debug",21036,1,7) = "Event:feature_set|<response command='feature_set' feature='max_children' success='1' transaction_id='2'/>"
17:  ^CacheTemp.ISC.Atelier("debug",21036,1,8) = "Received:feature_set -i 3 -n max_depth -v 2"
18:  ^CacheTemp.ISC.Atelier("debug",21036,1,9) = "Calling state feature_set"
19:  ^CacheTemp.ISC.Atelier("debug",21036,1,10) = "Event:feature_set|<response command='feature_set' feature='max_depth' success='1' transaction_id='3'/>"
20:  ^CacheTemp.ISC.Atelier("debug",21036,1,11) = "Received:feature_set -i 4 -n notify_ok -v 1"
21:  ^CacheTemp.ISC.Atelier("debug",21036,1,12) = "Calling state feature_set"
22:  ^CacheTemp.ISC.Atelier("debug",21036,1,13) = "Event:feature_set|<response command='feature_set' feature='notify_ok' success='1' transaction_id='4'/>"
23:  ^CacheTemp.ISC.Atelier("debug",21036,1,14) = "Received:feature_set -i 5 -n debug_target -v_base64 VEFMOiMjY2xhc3MoQ05IU0EuUlBNUy5IZWxsb1dvcmxkKS5IZWxsbygp"
24:  ^CacheTemp.ISC.Atelier("debug",21036,1,15) = "Calling state feature_set"
25:  ^CacheTemp.ISC.Atelier("debug",21036,1,16) = "Launching: ##class(CNHSA.RPMS.HelloWorld).Hello()"
26:  ^CacheTemp.ISC.Atelier("debug",21036,1,17) = "PID 21004"
27:  ^CacheTemp.ISC.Atelier("debug",21036,1,18) = "Debug Device Name:|TCP|59094"
28:  ^CacheTemp.ISC.Atelier("debug",21036,1,19) = "Event:feature_set|<response command='feature_set' feature='debug_target' success='1' transaction_id='5'/>"
29:  ^CacheTemp.ISC.Atelier("debug",21036,1,20) = "Received:breakpoint_list -i 6"
30:  ^CacheTemp.ISC.Atelier("debug",21036,1,21) = "Calling state breakpoint_list"
31:  ^CacheTemp.ISC.Atelier("debug",21036,1,22) = "Event:breakpoint_list|<response command='breakpoint_list' transaction_id='6'></response>"
32:  ^CacheTemp.ISC.Atelier("debug",21036,1,23) = "Received:breakpoint_list -i 7"
33:  ^CacheTemp.ISC.Atelier("debug",21036,1,24) = "Calling state breakpoint_list"
34:  ^CacheTemp.ISC.Atelier("debug",21036,1,25) = "Event:breakpoint_list|<response command='breakpoint_list' transaction_id='7'></response>"
35:  ^CacheTemp.ISC.Atelier("debug",21036,1,26) = "Received:breakpoint_list -i 8"
36:  ^CacheTemp.ISC.Atelier("debug",21036,1,27) = "Calling state breakpoint_list"
37:  ^CacheTemp.ISC.Atelier("debug",21036,1,28) = "Event:breakpoint_list|<response command='breakpoint_list' transaction_id='8'></response>"
38:  ^CacheTemp.ISC.Atelier("debug",21036,1,29) = "Received:breakpoint_set -i 9 -t line -s enabled -f dbgp://|TAL|CNHSA.RPMS.HelloWorld.cls -m Hello -n 2"
39:  ^CacheTemp.ISC.Atelier("debug",21036,1,30) = "Calling state breakpoint_set"
40:  ^CacheTemp.ISC.Atelier("debug",21036,1,31) = "mapping: TAL:CNHSA.RPMS.HelloWorld.cls:Hello:2 -> CNHSA.RPMS.HelloWorld.1:7"
41:  ^CacheTemp.ISC.Atelier("debug",21036,1,32) = "Setting BP"
42:  ^CacheTemp.ISC.Atelier("debug",21036,1,33) = "IsStopped"
43:  ^CacheTemp.ISC.Atelier("debug",21036,1,34) = "Location zDebugStub+27:%Debugger.System.1:0:0:0:0:6:0:0:0:0:0:TAL"
44:  ^CacheTemp.ISC.Atelier("debug",21036,1,35) = "Stack 3^zDebugStub+27^%Debugger.System.1"
45:  ^CacheTemp.ISC.Atelier("debug",21036,1,36) = "BP enabled:CNHSA.RPMS.HelloWorld.1(7)::0"
46:  ^CacheTemp.ISC.Atelier("debug",21036,1,37) = "Event:breakpoint_set|<response command='breakpoint_set' transaction_id='9' state='enabled' id='1'/>"
47:  ^CacheTemp.ISC.Atelier("debug",21036,1,38) = "Received:breakpoint_set -i 10 -t line -s enabled -f dbgp://|TAL|CNHSA.RPMS.HelloWorld.cls -m Hello -n 2"
48:  ^CacheTemp.ISC.Atelier("debug",21036,1,39) = "Calling state breakpoint_set"
49:  ^CacheTemp.ISC.Atelier("debug",21036,1,40) = "mapping: TAL:CNHSA.RPMS.HelloWorld.cls:Hello:2 -> CNHSA.RPMS.HelloWorld.1:7"
50:  ^CacheTemp.ISC.Atelier("debug",21036,1,41) = "Setting BP"
51:  ^CacheTemp.ISC.Atelier("debug",21036,1,42) = "IsStopped"
52:  ^CacheTemp.ISC.Atelier("debug",21036,1,43) = "Location zDebugStub+27:%Debugger.System.1:0:0:0:0:6:0:0:0:0:0:TAL"
53:  ^CacheTemp.ISC.Atelier("debug",21036,1,44) = "Stack 3^zDebugStub+27^%Debugger.System.1"
54:  ^CacheTemp.ISC.Atelier("debug",21036,1,45) = "BP enabled:CNHSA.RPMS.HelloWorld.1(7)::0"
55:  ^CacheTemp.ISC.Atelier("debug",21036,1,46) = "Event:breakpoint_set|<response command='breakpoint_set' transaction_id='10' state='enabled' id='2'/>"
56:  ^CacheTemp.ISC.Atelier("debug",21036,1,47) = "Received:run -i 11"
57:  ^CacheTemp.ISC.Atelier("debug",21036,1,48) = "Calling state run"
58:  ^CacheTemp.ISC.Atelier("debug",21036,1,49) = "IsStopped"
59:  ^CacheTemp.ISC.Atelier("debug",21036,1,50) = "Location zHello+2:CNHSA.RPMS.HelloWorld.1:7:8:7:18:0:7:8:7:18:0:TAL"
60:  ^CacheTemp.ISC.Atelier("debug",21036,1,51) = "Stack 3^zDebugStub+30^%Debugger.System.1:5^zHello+2^CNHSA.RPMS.HelloWorld.1"
61:  ^CacheTemp.ISC.Atelier("debug",21036,1,52) = "Hit A BreakPoint"
62:  ^CacheTemp.ISC.Atelier("debug",21036,1,53) = "Event:status|<response command='run' status='break' reason='ok' transaction_id='11'/>"
63:  ^CacheTemp.ISC.Atelier("debug",21036,1,54) = "Received:stack_get -i 12"
64:  ^CacheTemp.ISC.Atelier("debug",21036,1,55) = "Calling state stack_get"
65:  ^CacheTemp.ISC.Atelier("debug",21036,1,56) = "stack: 3^zDebugStub+30^%Debugger.System.1:5^zHello+2^CNHSA.RPMS.HelloWorld.1"
66:  ^CacheTemp.ISC.Atelier("debug",21036,1,57) = "mapping:zHello+2^CNHSA.RPMS.HelloWorld.1 -> TAL:CNHSA.RPMS.HelloWorld.cls:Hello:2"
67:  ^CacheTemp.ISC.Atelier("debug",21036,1,58) = "Event:stack_get|<response command='stack_get' transaction_id='12'><stack level='1' type='file' filename='dbgp://%7CTAL%7CCNHSA.RPMS.HelloWorld.cls' method='Hello' methodoffset='2' lineno='2'/></response>"
68:  ^CacheTemp.ISC.Atelier("debug",21036,1,59) = "Received:context_names -i 13 -d 1"
69:  ^CacheTemp.ISC.Atelier("debug",21036,1,60) = "Calling state context_names"
70:  ^CacheTemp.ISC.Atelier("debug",21036,1,61) = "IsStopped"
71:  ^CacheTemp.ISC.Atelier("debug",21036,1,62) = "Location zHello+2:CNHSA.RPMS.HelloWorld.1:7:8:7:18:0:7:8:7:18:0:TAL"
72:  ^CacheTemp.ISC.Atelier("debug",21036,1,63) = "Stack 3^zDebugStub+30^%Debugger.System.1:5^zHello+2^CNHSA.RPMS.HelloWorld.1"
73:  ^CacheTemp.ISC.Atelier("debug",21036,1,64) = "IsStopped"
74:  ^CacheTemp.ISC.Atelier("debug",21036,1,65) = "Location zHello+2:CNHSA.RPMS.HelloWorld.1:7:8:7:18:0:7:8:7:18:0:TAL"
75:  ^CacheTemp.ISC.Atelier("debug",21036,1,66) = "Stack 3^zDebugStub+30^%Debugger.System.1:5^zHello+2^CNHSA.RPMS.HelloWorld.1"
76:  ^CacheTemp.ISC.Atelier("debug",21036,1,67) = "Event:context_names|<response command='context_names' transaction_id='13'><context name='Local' id='0'/><context name='Global' id='1'/></response>"
77:  ^CacheTemp.ISC.Atelier("debug",21036,1,68) = "Received:context_get -i 14 -d 1 -c 0"
78:  ^CacheTemp.ISC.Atelier("debug",21036,1,69) = "Calling state context_get"
79:  ^CacheTemp.ISC.Atelier("debug",21036,1,70) = "IsStopped"
80:  ^CacheTemp.ISC.Atelier("debug",21036,1,71) = "StackLevel IDE->Cache:1->5"
81:  ^CacheTemp.ISC.Atelier("debug",21036,1,72) = "StackVars lev=5"
82:  ^CacheTemp.ISC.Atelier("debug",21036,1,73) = "IsStopped"
83:  ^CacheTemp.ISC.Atelier("debug",21036,1,74) = "Location zHello+2:CNHSA.RPMS.HelloWorld.1:7:8:7:18:0:7:8:7:18:0:TAL"
84:  ^CacheTemp.ISC.Atelier("debug",21036,1,75) = "Stack 3^zDebugStub+30^%Debugger.System.1:5^zHello+2^CNHSA.RPMS.HelloWorld.1"
85:  ^CacheTemp.ISC.Atelier("debug",21036,1,76) = "Context:0:~var:HELLO WORLD"
86:  ^CacheTemp.ISC.Atelier("debug",21036,1,77) = "Event:context_get|<response command='context_get' context='0' transaction_id='14'><property name='var' fullname='var' type='string' constant='0' children='0' size='11' numchildren='0' encoding='none'>HELLO WORLD</property></response>"

Hi Jordan, 

You can also use Serenji when debugging in VS Code - https://openexchange.intersystems.com/package/Serenji

It's an on-the-spot debugger from George James Software, with zero configuration for users - so you can debug whenever, wherever you are without losing focus. It also takes advantage of the latest features within VS Code itself such as CodeLenses. 

Our YouTube channel has a Serenji playlist which shows off how some of these features work - https://www.youtube.com/@GJSoftware/featured

Happy to chat if you're interested in finding out more!

Thanks, Laurel