[Lazarus] Debugger Error: "PC register is not available"

Martin lazarus at mfriebe.de
Sun Mar 18 04:40:05 CET 2012

On 18/03/2012 02:47, John Repucci wrote:
> I just encountered the below pop-up error message when debugging.
> Within that one session of Laz, I was able to reproduce the message,
> but once I existed / restarted Lazarus, it did not reoccur.
> Any suggestions for the next time I encounter it?
> code segment:  sA,sB are strings; I was able to step past the sA line
> and sA evaluated correctly.  Every time I attempted to step over the
> sB line, I received the error.
>    sA := KeyStrings.Strings[0];
>    sB := KeyStrings.Strings[1];
> ---------------------------
> Debugger Error
> The debugger encountered an error when trying to run/step the application:
> PC register is not available
> Press "OK" .... [etc ...]
> The more button gives ",msg="PC register is not available""
> ---------------------------
> Laz: 0.9.31-35589, 2.6.1, win32, running on a Win7-64 bit system.

I have seen this, but I do not yet have a solution.   Though I am sure 
it is a bug in gdb.

It can happen if you press "pause", or if you change a breakpoint while 
the app is running. But only, if the app hits a breakpoint at this very 
exact moment.
Changing breakpoints while paused is safe.

Unfortunately once it has happen there is no way out (no known way 
anyway). If it does happen please send the content of the "Debug Output" 

There may be a newer version of gdb available. I have not yet checked 
for 64 bit.

On 32 bit windows, I know that one of the causes (there seem to be more) 
was fixed in 7.0.50, but then re introduced in the next version.
There is a test case in the test directory. 
(debugger/test/gdbmi/TestGdbmi) By default it ignores the error for most 
gdb versions (But if you specify a log file, you can see if it did 
ignore). So in order to test, it must be edited. Also I am not sure, if 
it does always fail....

More information about the Lazarus mailing list