Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi exceptions not letting me see local variables

Tags:

delphi

When debugging in Delphi, an exception will correctly tell me the line of code causing the fault, but I cannot get access to any local variables. Is this a limitation in the debugger? Or am I missing something simple? At present, I have to mirror all local variables to a global on the line before the fault, recompile the program and hope to be able to repeat the same exception.

For example

MyArray[I]:=Foo(...); 

If I is out of bounds (with bounds checking turned on), I cannot see what the variable I is, unless I mirrored it to a globally scoped debug variable on the previous line.

Or if I have

MyInteger:=Trunc(MyFloat), 

and MyFloat is 6.1E+17, I have no idea what it's value is.

like image 470
Robert Richter Avatar asked Oct 14 '12 18:10

Robert Richter


1 Answers

You can see the values of local variables when you select the proper line in the call stack window. It is usually one or two lines before the exception is raised.

I don't have the exact version at hand when this has been implemented, but it is definitely one of the newer versions.

like image 135
Uwe Raabe Avatar answered Sep 21 '22 11:09

Uwe Raabe