Delphi 7: how to see the value of local variables upper in the call stack?
Asked Answered
L

1

6

In Delphi 7, while debugging I can see the current context local variables (Ctrl-Alt-L), and the call stack (Ctrl-Alt-S). When I navigate the call stack back to the caller methods, I don't know how to inspect the caller local variables. Is it possible?

This is an old pet peeve of mine. I can do it in all the languages I've programmed, but not in Delphi.

Lynelllynelle answered 2/1, 2012 at 14:9 Comment(2)
As far as I know unless you have a reference back to it from where the debug is you can't. Good question though, if there's a better answer I'd like to know it as well.Nonpareil
In Delphi XE the contents of local variables window changes according to the selected caller method in call stack window. Sorry, I don't have Delphi 7 on my laptop.Myrtismyrtle
B
2

The feature you are looking for was added to the Win32 debugger in Delphi 2005:

Delphi 2005 Reviewer's Guide

...

A popular debugging feature in Delphi 8 and C# Builder is the capability to select a particular frame from the call stack using the Local Variables dialog box. This feature is now available for the Borland Win32 Debugger.

With the Borland Win32 Debugger loaded, view the Local Variables dialog box. (If this dialog box is not already visible, select View | Debug Windows | Local Variables, or press Ctrl-Alt-L, to display it.) Initially, the values of variables local to the current function that the debugger is in are shown. To view local variables in one of the methods earlier in the call chain, select the method name from the drop-down menu.


(source: embarcadero.com)


In Delphi 7 the local variables view always shows the local variables for the function in which execution has broken on.

Bemuse answered 2/1, 2012 at 15:33 Comment(2)
Ok, the easy way doesn't work in Delphi 7, but is there any convoluted way to see the stack variables values?Lynelllynelle
So, it is impossible to do it in Delphi 7. I was afraid that this would be the answer. Thanks, I'll accept your answer.Lynelllynelle

© 2022 - 2024 — McMap. All rights reserved.