Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Xiangrong Fang
Thanks for the explanation. Now I see why my program some time crashed at gtk2*.inc... 2013/3/14 Martin > On 14/03/2013 09:47, Jonas Maebe wrote: > > > On 14 Mar 2013, at 01:48, Xiangrong Fang wrote: > > The document said it is "deprecated"? Also, I want this to be cross > platform, not for u

Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Martin
On 14/03/2013 09:47, Jonas Maebe wrote: On 14 Mar 2013, at 01:48, Xiangrong Fang wrote: The document said it is "deprecated"? Also, I want this to be cross platform, not for unix only. The use case is: try buf := GetMemory(1024); size := 10240; stream.Read(buf^, size); except ?? end; T

Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Jonas Maebe
On 14 Mar 2013, at 11:16, Tomas Hajny wrote: On Thu, March 14, 2013 09:23, Xiangrong Fang wrote: I am sorry that was what I thought, but does not work, see screenshot attached. The screenshot does not show where exactly the problem happens (except for the address, but that is useless with

Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Tomas Hajny
On Thu, March 14, 2013 09:23, Xiangrong Fang wrote: > 2013/3/14 Mattias Gaertner >> On Thu, 14 Mar 2013 07:05:21 +0800 >> Xiangrong Fang wrote: >> >> > Is it possible to use try...except to catch SIGSEGV? >> >> yes. The exception class is EAccessViolation. > > I am sorry that was what I thought,

Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Jonas Maebe
On 14 Mar 2013, at 01:48, Xiangrong Fang wrote: The document said it is "deprecated"? Also, I want this to be cross platform, not for unix only. The use case is: try buf := GetMemory(1024); size := 10240; stream.Read(buf^, size); except ?? end; That use case is a textbook example of why

Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Mattias Gaertner
On Thu, 14 Mar 2013 07:05:21 +0800 Xiangrong Fang wrote: > Is it possible to use try...except to catch SIGSEGV? yes. The exception class is EAccessViolation. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.

Re: [fpc-pascal] catch segfaults

2013-03-14 Thread Tomas Hajny
On Thu, March 14, 2013 01:48, Xiangrong Fang wrote: > 2013/3/14 Ewald >> Once upon a time, Xiangrong Fang said: >> > Is it possible to use try...except to catch SIGSEGV? >> I don't know if it is possible, but how about using fpSignal()? See >> http://www.freepascal.org/docs-html/rtl/baseunix/fpsig

Re: [fpc-pascal] catch segfaults

2013-03-13 Thread Xiangrong Fang
The document said it is "deprecated"? Also, I want this to be cross platform, not for unix only. The use case is: try buf := GetMemory(1024); size := 10240; stream.Read(buf^, size); except ?? end; 2013/3/14 Ewald > Once upon a time, Xiangrong Fang said: > > Is it possible to use try...

Re: [fpc-pascal] catch segfaults

2013-03-13 Thread Ewald
Once upon a time, Xiangrong Fang said: > Is it possible to use try...except to catch SIGSEGV? I don't know if it is possible, but how about using fpSignal()? See http://www.freepascal.org/docs-html/rtl/baseunix/fpsignal.html -- Ewald ___ fpc-pascal mai

[fpc-pascal] catch segfaults

2013-03-13 Thread Xiangrong Fang
Is it possible to use try...except to catch SIGSEGV? Thanks! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal