Hello,
I have a simple exception handler to work around an occasional problem. The code is as follows:
{$ifdef UseWordAccessWorkaround}
try
{ FPC v3.0.4 generates a word access for the expression below. This }
{ causes an access violation if the last byte in the block is also }
{ last accessible byte. The try/except is to work around that bug. }
HexPtr^ := HexDigits[p^ and $F]; { second nibble }
except
b := p^; { these instructions do }
b := b and $F; { not generate a word }
HexPtr^ := HexDigits[b]; { access. }
end;
{$endif}
when the program is executed from the command line, the exception handler handles the exception and execution resumes normally.
When running the program under GDB, GDB gets "stuck" at
HexPtr^ := HexDigits[p^ and $F]; { second
instead of transferring control to the exception handler.
the question is: how do I tell GDB to transfer control to the exception handler so execution resumes normally ? F7/F8/F9 only seem to cause the exception again.
Attached is a complete sample program which executes as it should when invoked on the command line but gets stuck on the offending line as described above when run under GDB.
Thank you for your help.
PS: FPC v3.0.4, Windows 7 64bit.