You could display the CPU view and then use F7 to single step thru the assembly code which is between the begin and the first method code line. This assembly code will reserve space for local variable and initialize those having to be initialized.
CPU View is your friend for such AVs, begin/end is where all the automatic setup, implicit exception frames, implicit initialization & cleanups go (and they can be mighty complex when the procedure uses strings, interfaces, etc.)
It depends where the begin statement exists...
ReplyDeletestart by disabling some plugins... or maybe it's a bug in your [version?] of the IDE
ReplyDelete'begin' in the main program or in a method? If it is in the main program, all 'initialization' blocks are execute when you press F8.
ReplyDeleteSorry, begin is at the start of a method
ReplyDeleteYou could display the CPU view and then use F7 to single step thru the assembly code which is between the begin and the first method code line. This assembly code will reserve space for local variable and initialize those having to be initialized.
ReplyDeleteAs François Piette said.
ReplyDeleteVirtual Method call on a invalid object reference?
ReplyDeleteOr - one of the arguments into the method is a virtual method call on an invalid object reference.
One of the things to check - when the debugger is stopped on the breakpoint (on 'begin'), evaluate 'Self'. Maybe it is 'nil'.
ReplyDeleteIt might not be nil, if you didn't call FreeAndNil ;)
ReplyDeleteOh, I am loathe to admit it, but with this codebase I am having to use FreeAndNil -- the pointers are out of control.
ReplyDeleteJust like I said in my article. ;-)
Hey, the first thing you have to do before cleaning them all up is make them not AV. ;-)
ReplyDeleteAnd what you have to do before that is to remove all the empty try...except...end blocks! ;-) AV's aren't AV's if the user never sees them!!!!
ReplyDeleteCPU View is your friend for such AVs, begin/end is where all the automatic setup, implicit exception frames, implicit initialization & cleanups go (and they can be mighty complex when the procedure uses strings, interfaces, etc.)
ReplyDelete