I have a strange error, that does not occur on each machine. I created an application with Lazarus. If I start it on a second laptop, then I get the error 'Invalid class .' Press OK etc. Does someone have seen this before, and is there some clue where to search for? It is running fine on my development environment. It is not much info, but it is all I have.
You could copy gdb.exe on your laptop (where you get the error). You should at least compile your app with line info -gl (but ideally debug info: -gw )
gdb.exe yourproject.exe
b FPC_RAISEEXCEPTION
b FPC_RUNERROR
r
If you hit FPC_RUNERROR => then there is no exception message (there may be a subsequent exception). However, a FPC_RUNERROR means you should be at the point of error that is of interrest. RunErrors should not happen otherwise.
If you hit an FPC_RAISEEXCEPTION, you may want to check if it is the one your are looking for. There may be other, expected exceptions that will be caught and that you need to skip.
To
continue your app when gdb paused it (e.g. if you are at an unrelated exception:
c (and enter)
If you got the right exception, get a
stacktrace:
btTo see the exception message (replace $rcx as needed):
- If you have full debug info:
x/s Exception($rcx).FMessage or sometimes:
x/s ^Exception($rcx)^.FMessage- If the above does not work:
x/s ^^char(^^char($rcx)+1)^Depending on your OS:
- On Win 64 use
$rcx- On Linux 64 use
$rdi- On Win 32 use
$eaxIf you can't get the exception message, just get the stacktrace, and continue. You will then see, if the error message pops up, or if you run into another exception later.