Automatic Watch variables

Primary tabs

I come from Visual Studio and now I use mostly Cache 2017 Studio. One debugging functionality I miss dearly is current local variables automatically appearing in the Watch Variables window together with their values. Yes, I can hover or type them myself but both actions take extra time which is especially noticeable when debugging unfamiliar code across many routines. Any Cache settings or plugins to that effect? If not then why not? And if nothing else is there in Cache, what are the alternatives or hacks in this respect?

Anna

Replies

once your debugger is attached to a process you press ALT+4 /(Watch Window)

sorry, have just my German version at hands

next  you type the variable you want to see and it gets updated at every step

see “Using the Studio Debugger.”

details Watch Window

Hi Robert,

That I know how to do and I do it. What I would like to have this way or other is that the file name appears in the Watch window by itself when I am on the line with this variable, the way Microsoft Visual Studio works, say, with debugging C++.

Anna
P.S German was an unexpected bonus for my one year long studies of it. I could translate about half of German words on your screenshot so not even A1 yet smiley .

AHHH!
that sort of comfort isn't foreseen.
You have to type in the variable names.
But you see it when you move the cursor over the variable in the code window as "hoover"-text.
The Watch Window is useful if you have objects, or $LB structures, arrays, ... or obj.property.

Schönen Abend noch aus Wien.

Yes, yes. all that is good and I use it but that comfort, arghhh...

Schönen Abend aus Boston,
Anna

I have not been worked with Visual Studio, so, have no idea how it works there. But Instead of Studio, I would recommend using VSCode, of course, it already supports debugging, for sure you can watch variables (and expressions) as well as hovering variables. It does not support objects in a some readable way but supports it as an expression, so obj.property will work.

Watching variables by typing them as well as hovering works in Cache Studio too. I am interested in automatically appearing (and disappearing) watch variables. Basically the debugger flow in this respect would be:

s a=1 ; When debugger is on this line show value of a automatically; don't show c yet; showing value of b is optional
s b=2 ; When debugger is on this line show value of b automatically; showing  value of a is optional
s c=3 ; When debugger is on this line show value of c automatically; showing  value of b is optional; stop showing a

Now, I don't know the exact Visual Studio rules when they start and stop showing a variable but the current line variables are always shown. No hovering or typing needed.

In Studio if you open Watch view and select Call Stack tab and then select particular line then in the right part you'll see variables for current stack

This is indeed the place for current local variables, thanks! However it has a minor and a major problems in my Cache 2017 instance. The minor problem is that I need to right click in the area to display those variables which disappear again with the next debugging step. So it is sort of semi-automatic. The major problem that this action freezes Studio pretty quickly. Maybe this freezing is fixed in subsequent releases, I don't know.

I also don't know if this is fixed. Studio is backwards compatible, so you can try to use Studio from Caché 2018.1.4 to connect to Caché 2017.1 or Caché 2017.2 instance. Or you even can try to use IRIS Studio 2020.1