Question
· Sep 30, 2022

VS Code - Breakpoint Cannot Be mapped

Issue

Breakpoints do not work when using VS Code Debug this method feature on a ClassMethod. Debug runs like normal and I can sometimes see 'running' on the CALL STACK menu. In the BREAKPOINTS menu, the breakpoints will start red, like normal, but eventually turn gray. On-hover for a grey breakpoint is the message "Breakpoint Cannot Be Mapped". After the method finishes, the breakpoint turns red again. No error messages appear. This is an intermittent issue, as sometimes it runs fine. So far, I have not been able to figure out the conditions to re-create this issue.

 

Any suggestions?

Edit: 

After playing around with the code for awhile, I think I've found a method to reproduce the issue. It revolves around adding or modifying comments inside of a class using /* */ and //, but not modifying any code. Interestingly, method comments using #; don't produce the same issue.

Product version: IRIS 2021.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:48:12 EDT
Discussion (6)3
Log in or sign up to continue

1:     ^IRIS.Temp.Atelier("debug")    =    1
2:     ^IRIS.Temp.Atelier("debug",127434)    =    1
3:     ^IRIS.Temp.Atelier("debug",127434,1,0)    =    42
4:     ^IRIS.Temp.Atelier("debug",127434,1,1)    =    "Event:init|<init appid=""AtelierDebugger""      idekey=""Atelier""      session=""127434""      thread=""1""      parent=""IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:48:12 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>"
5:     ^IRIS.Temp.Atelier("debug",127434,1,2)    =    "Received:feature_set -i 1 -n max_data -v 8192"
6:     ^IRIS.Temp.Atelier("debug",127434,1,3)    =    "Calling state feature_set"
7:     ^IRIS.Temp.Atelier("debug",127434,1,4)    =    "Event:feature_set|<response command='feature_set' feature='max_data' success='1' transaction_id='1'/>"
8:     ^IRIS.Temp.Atelier("debug",127434,1,5)    =    "Received:feature_set -i 2 -n max_children -v 32"
9:     ^IRIS.Temp.Atelier("debug",127434,1,6)    =    "Calling state feature_set"
10:     ^IRIS.Temp.Atelier("debug",127434,1,7)    =    "Event:feature_set|<response command='feature_set' feature='max_children' success='1' transaction_id='2'/>"
11:     ^IRIS.Temp.Atelier("debug",127434,1,8)    =    "Received:feature_set -i 3 -n max_depth -v 2"
12:     ^IRIS.Temp.Atelier("debug",127434,1,9)    =    "Calling state feature_set"
13:     ^IRIS.Temp.Atelier("debug",127434,1,10)    =    "Event:feature_set|<response command='feature_set' feature='max_depth' success='1' transaction_id='3'/>"
14:     ^IRIS.Temp.Atelier("debug",127434,1,11)    =    "Received:feature_set -i 4 -n notify_ok -v 1"
15:     ^IRIS.Temp.Atelier("debug",127434,1,12)    =    "Calling state feature_set"
16:     ^IRIS.Temp.Atelier("debug",127434,1,13)    =    "Event:feature_set|<response command='feature_set' feature='notify_ok' success='1' transaction_id='4'/>"
17:     ^IRIS.Temp.Atelier("debug",127434,1,14)    =    "Received:feature_set -i 5 -n debug_target -v_base64 VlVNQ1BSSU1BUlk6IyNjbGFzcyhWVU1DLlV0aWxpdHkuQ2VybmVyTGFiRnVuY3Rpb25zKS5WVU1DU2VsZWN0UGVyZm9ybWluZ0xhYkFyZWEoIk9SRDAwMDAzMTQiLCJFRFAiLCJTVCIp"
18:     ^IRIS.Temp.Atelier("debug",127434,1,15)    =    "Calling state feature_set"
19:     ^IRIS.Temp.Atelier("debug",127434,1,16)    =    "Launching: ##class(Custom.Utility.Functions).SelectArea(""arg1"",""arg2"",""arg3"")"
20:     ^IRIS.Temp.Atelier("debug",127434,1,17)    =    "PID 130498"
21:     ^IRIS.Temp.Atelier("debug",127434,1,18)    =    "Debug Device Name:|TCP|34811"
22:     ^IRIS.Temp.Atelier("debug",127434,1,19)    =    "Event:feature_set|<response command='feature_set' feature='debug_target' success='1' transaction_id='5'/>"
23:     ^IRIS.Temp.Atelier("debug",127434,1,20)    =    "Received:breakpoint_list -i 6"
24:     ^IRIS.Temp.Atelier("debug",127434,1,21)    =    "Calling state breakpoint_list"
25:     ^IRIS.Temp.Atelier("debug",127434,1,22)    =    "Event:breakpoint_list|<response command='breakpoint_list' transaction_id='6'></response>"
26:     ^IRIS.Temp.Atelier("debug",127434,1,23)    =    "Received:breakpoint_set -i 7 -t line -s enabled -f dbgp://|PRIMARY|Custom.Utility.Functions.cls -m SelectArea -n 1"
27:     ^IRIS.Temp.Atelier("debug",127434,1,24)    =    "Calling state breakpoint_set"
28:     ^IRIS.Temp.Atelier("debug",127434,1,25)    =    "mapping: PRIMARY:Custom.Utility.Functions.cls:SelectArea:1 -> :-1"
29:     ^IRIS.Temp.Atelier("debug",127434,1,26)    =    "Event:error|<response command='breakpoint_set' transaction_id='7'><error code='201'><message>Breakpoint Cannot Be Mapped</message></error></response>"
30:     ^IRIS.Temp.Atelier("debug",127434,1,27)    =    "Received:breakpoint_list -i 8"
31:     ^IRIS.Temp.Atelier("debug",127434,1,28)    =    "Calling state breakpoint_list"
32:     ^IRIS.Temp.Atelier("debug",127434,1,29)    =    "Event:breakpoint_list|<response command='breakpoint_list' transaction_id='8'></response>"
33:     ^IRIS.Temp.Atelier("debug",127434,1,30)    =    "Received:run -i 9"
34:     ^IRIS.Temp.Atelier("debug",127434,1,31)    =    "Calling state run"
35:     ^IRIS.Temp.Atelier("debug",127434,1,32)    =    "IsStopped"
36:     ^IRIS.Temp.Atelier("debug",127434,1,33)    =    "Location zDebugStub+40:%Debugger.System.1:0:0:0:0:6:0:0:0:0:0:PRIMARY"
37:     ^IRIS.Temp.Atelier("debug",127434,1,34)    =    "Stack 3^zDebugStub+40^%Debugger.System.1"
38:     ^IRIS.Temp.Atelier("debug",127434,1,35)    =    "Ran Off End"
39:     ^IRIS.Temp.Atelier("debug",127434,1,36)    =    "FlushOut"
40:     ^IRIS.Temp.Atelier("debug",127434,1,37)    =    "Timed out"
41:     ^IRIS.Temp.Atelier("debug",127434,1,38)    =    "IsStopped"
42:     ^IRIS.Temp.Atelier("debug",127434,1,39)    =    "Event:stop|<response command='run' status='stopped' reason='ok' transaction_id='9'/>"
43:     ^IRIS.Temp.Atelier("debug",127434,1,40)    =    "TidyUp: 1"
44:     ^IRIS.Temp.Atelier("debug",127434,1,41)    =    "Exiting"
45:     ^IRIS.Temp.Atelier("debug",127434,1,42)    =    "OnClose"

I think the problem is that it is not re-compiling after change, because the code doesn't change. Below is what I get when changing a comment.

Compilation started on 10/05/2022 11:37:01 with qualifiers 'cuk'
Class Custom.Utility.Functions is up-to-date.
Compilation finished successfully in 0.002s.

FYI, its not an issue for me anymore. I've been adding a space or something in the code to force a re-compile and it works. Mostly just annoying.