How can I find the location of a "List index out of bounds" error in Delphi

Hey, you don't need any additional tools to track this! :)

Just run your application under debugger and make sure that "Stop on Delphi Exceptions" (or whatever it is called in your Delphi's version) is turned ON.

When exception occurs - there will be a notification from debugger. Press "Ok"/"Debug" button and just view the call stack. Call stack window is shown automatically in recent Delphi's version. If you can not see it - go to "View"/"Debug Windows"/"Call stack".

That's all. The call stack will point you at the exact location of the problem. No additional tool needed.

Those tools (EurekaLog, JCL or madExcept) are needed if you distribute your program among users and want to gather bug-reports about problems on client side. I.e. there is no debugger to check the problem.


Do you have "Stop on Delphi Exceptions" turned on? (Tools\Debugger Options\Language Exceptions [Delphi7]) Otherwise it won't break in your sourcecode.

Also make sure that EListError is not in your "Exception Types to Ignore" list. This list is also found at Tools\Debugger Options\Language Exceptions (Delphi 7).


madExcept (free) or EurekaLog (paid) may help. You can set them up to show/email a stack trace when an error occurs. I use EurekaLog in all my projects and it is invaluable for fixing these kinds of things.


As this is an RTL/VCL error, you often end up with better breaking/callstack behaviour if you enable Debug DCU's (and rebuild).