[fpc-pascal] Runs correctly when debugging.

Henry Vermaak henry.vermaak at gmail.com
Sat May 5 00:21:17 CEST 2012


On 4 May 2012 23:03, Henry Vermaak <henry.vermaak at gmail.com> wrote:
> On 4 May 2012 22:14, Guillermo Martínez Jiménez <gmartinez at burdjia.com> wrote:
>> Hello everybody,
>>
>> I'm working on a wrapper of a C library.  I've found a bug, but I
>> can't debug it with GDB because if I compile with "-g" and link with
>> the debug version of the library it works correctly.
>>
>> But if I compile with "-g" and link with the release version of the
>> library, I can't debug it because it fails inside the library.  So I
>> suspect there's a problem with a data conversion CPU exception
>> activated by FPC.
>
> Can you give any more information about how it fails?  You may have to
> set the fpu exception mask if you're talking to c code, as a quick
> guess (search the archives for how).  Don't know why this works with
> debugging enabled, though.

e.g.

  {$if defined(cpui386) or defined(cpux86_64)}
    SetExceptionMask(GetExceptionMask + [exZeroDivide, exInvalidOp]);
  {$ifend}



More information about the fpc-pascal mailing list