· Jan 19, 2021

Debugging: Lost/Missing debugging functionality

I have multiple projects that I utilize when debugging in Cache Studio. One of my projects suddenly lost the ability to step through commands with the yellow box and the cursor moving though code lines. The cursor just sits at the entry line while variables apparently do change. Interestingly enough, if I change the project and the debug target, the "yellow box" ability is still there. Apparently losing this functionality is by project/debug target/whatever. The goal is, of course to return it back but how?
P.S. Maybe it is some odd Cache Studio registry corruption or some Cache system global corruption? Just a guess. I did see this problem before a long time ago.

Product version: Caché 2017.1
Discussion (24)2
Log in or sign up to continue

So, you tried to debug INT code, and it did not work properly? Is it reproducible, and what will happen if you recompile it? And, still interesting how it will be in VSCode at the same time.

Just curious, did you miss anything in VSCode, or you faced some issues there, so, you decided to stay with Studio? You may answer me in direct messages, to keep this topic clear.

I've seen such behavior during debugging when I fell into some deployed system code (.obj only)
A similar effect happened to me when I touched some customized command, function, variable from ZLANG***
[which I tried to debug !!!]

I could gain control again by some <SHIFT><F11>  until returning to some code covered by .int
As Studio stores a lot of info in the Windows registry just killing Studion might cause some confusion. 

I am not sure I am falling into the .obj code with this problem but maybe I do.  Just to be clear what is happening and what is not, a couple of screenshots.
1) TestAG^TestAG is the debug target, hand-written routine, and I pressed Go once, so presumably the debugger now sits at this breakpoint. However, no yellow box and the cursor is one line up. Shift+F11 does not make the cursor or the yellow box to appear anywhere else (I have other breakpoints too).

2) This is normal behavior. last is the debug target and the cursor correctly stops at the programmatic breakpoint with a suitable yellow box.

So any advice how to fix it?

Robert, a bit more info after I tested a bit more:

1) The first program above, TestAG exhibited the same corrupt debugging behavior when I set it up as debug target for another project however this another project started debugging alright when I switched to a yet another debug target:

2) Test in this comment above leads me to think that the corrupt debug behavior might be associated with a program more than with a project. I don't think it is associated with the old style b break since it behaves correctly, the same as before.

just tried to reproduce a similar case in Terminal.
#0) clear all stored  breakpoints (menu: Debug / View breakpoints / remove all)
#1) set the breakpoint in Studio using F9
#2) attach to process (shell if in Terminal)
#3) do ^yourroutine in terminal
#4) In Studio: <ctrl>+<F5>  let it run 
if your breakpoint is reached you see the yellow box

Hint: try it with some simple 5 line routine first

If you never see the yellow box then you just don't execute this line 

That's exactly the problem: the new breakpoint is reached but no yellow box and the cursor stays at the routine's first line. The code is executed though because the variable set right before this single breakpoint gets defined correctly as per Watch. I did follow your instructions except I still used the corrupt routine.

I doubt I can reproduce this corruption intentionally because that requires understanding why it got corrupted in the first place and that is still a mystery to me.

Alright, this particular saga suddenly came to the end revealing the bug, my own one. But it is sort of educational so some details. I am implementing source control like features on and off while inheriting one of the features from a previous programmer. The latter feature which I preserved was about adding a timestamp with the compilation time to the changed routine in the overwritten source control method, OnAfterCompile. OnAfterCompile was adding this timestamp, resaving the routine  directly in one of the internal routine globals, and it did NOT recompile the file again. That effectively still had the file internally marked as saved and compiled, no little cross in the Studio's routine tab, BUT that threw the .OBJ file mapping to the routine source code enough so the debug yellow box would refuse to appear and the cursor would not move from the first line. Many self eye-rolling emojis here...

How did I discover it? I need to modify this custom source control class and it was annoying to do so while the source control was on so I turned it off, moved functionality to my test routine, and observed with incredulity the long lost yellow debug box again....

P.S. On the plus side, I learned a lot about inner Cache workings due to this largely self-inflicted wound and I am happy it is over.

Losing debugging capabilities, Scenario #2.
A fellow programmer also lost her debugging capabilities some time ago though for different reasons and with different symptoms. I am not dead sure what happened in her case but it looks like some unfortunate combination of User Roles and Service Settings as defined in Management Portal. We discussed it today and she tried a few things. Changing the studio login user helped as well as changing localhost in Cache Server Manager to an actual IP address. Using Remote System Access from the cube was beneficial as well.

One late addition: I just lost this debugging functionality again, looks like because my code was going into a different namespace via zn "nsp". If I put the first breakpoint AFTER this zn, the cursor does not go to it and the yellow box does not appear. However, if I put my first breakpoint AT zn, the yellow box appears at it and stays with me after the breakpoint as well. Can't say it's a feature but then what?? smiley