How debug and don't stop on hardware exceptions lazarus / 12-Debugger ---------------------------------------------------------------------- Borneq · 2012-12-14 23:01 I analyze exceptions in FreePascal. I begin to understand software exceptions caused by raise, but no hardware like dividing by zero. When I debug my debug process has stopped. - how debug? - how FreePascal works with hardware exceptions? ---------------------------------------------------------------------- Martin_fr · 2012-12-14 23:26 Unfortunately this is a problem within GDB. Something that can not be fixed in Lazarus. http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#SigSegV_- _and_continue_debugging http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Hardware_exceptio ns_under_Mac_OS_X If you have floating point, you can somehow specify that no exception is triggered (unit math). But otherwise, I do not know any solution, except for changing the code. ---------------------------------------------------------------------- Borneq · 2012-12-14 23:41 Quote from: Martin_fr on December 15, 2012, 12:26:50 amIf you have floating point, you can somehow specify that no exception is triggered (unit math). But otherwise, I do not know any solution, except for changing the code. Hardware exceptions is needed but how FreePascal handle it? He not use Structured Exeptions Handling provided with Windows but use own method. How can catch system signal ? I attach files: handling1.lpr - standard try-except to disassembling and debug own_handling1.dpr - exceptions with fpc_XXX methods (for Delphi) instead try-except sugar, work for software raise fine, but not for hardware exceptions Fpc_exceptions.pas - unit with functions fpc_XXX for Delphi ---------------------------------------------------------------------- Blaazen · 2012-12-15 00:25 IIRC there were some discussion on mailing list about this and Jonas Maebe explained how it works but I cannot find the right one (there are more threads about it). ---------------------------------------------------------------------- Borneq · 2012-12-15 00:35 Which is mailing list archive address? ---------------------------------------------------------------------- Blaazen · 2012-12-15 00:45 List of archives is here: http://www.freepascal.org/maillist.var IIRC the mentioned thread was on the FPC-General, which is also here: http://free-pascal-general.1045716.n5.nabble.com/ ---------------------------------------------------------------------- Martin_fr · 2012-12-15 01:09 From what I remember (and it may be inaccurate) A program can register (with the OS) a handler for hardware exceptions. On Linux this are Signal handlers, on win I don't remember what they are called. FPC does set such a handler, and then in that handler, if it is called, raises an exception. GDB does set it's own handler, and is supposed to call the programs (if registered) handler, in case that the user wishes to continue after such a condition occurred. The problem is, that at least on windows (and possible Mac) GDB can't do that (call the original handler). Not sure if that is a problem in GDB, IIRC I read some post it was a problem how windows works. But I can't judge that anyway. ---------------------------------------------------------------------- Borneq · 2012-12-15 02:04 In c:\lazarus\fpc\2.6.0\source\rtl\win32\system.pp in "procedure Exe_entry" is install_exception_handlers which call SetUnhandledExceptionFilter(@syswin32_i386_exception_handler); but this is not all