Re: [fpc-pascal] Exception withing exception handling
Am 18.02.2012 07:05 schrieb "Chad Berchek" : > > On 2/17/2012 2:26 PM, Sven Barth wrote: >> >> On 17.02.2012 18:36, Jorge Aldo G. de F. Junior wrote: > > >>> so i am inclined to think that exceptions arent supposed to live much >>> longer after their corresponding try except handling block. >>> >>> is that true ? actually, how are exceptions raised ? can i reraise one ? >> >> >> To make things short: yes, that is true. Exceptions are freed after >> either a except handler has handled it without reraising or after the >> "unhandled exception" handler has taken control (though in the last case >> it could be that the exception isn't freed, because the program is >> simply terminated...). > > > The AcquireExceptionObject function should be able to overcome this problem. It is designed to "acquire" a reference to the exception object so you sort of "own" it (actually it's reference counted; you own one refcount) and it won't be automatically freed after the except block. Be sure, then, in the destructor of Trowcolexception, to release the nested exception object. > > http://www.freepascal.org/docs-html/rtl/system/acquireexceptionobject.html > > http://www.freepascal.org/docs-html/rtl/system/releaseexceptionobject.html This is one of those moments where I need to aknowledge that even I never stop learning ;) Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
RE : RE : [fpc-pascal] Re: RE : Re: RE : FPCUp FPC/Lazarusinstaller/updater: first Linux/Windows version released
> > You can use the "-Xp" option to specify a path for FPC to > search for the > ppc* binaries. > > E.g. > > #!/bin/sh > ~/whereever/we/installed/fpc -n @~/whereever/we/installed/fpc.cfg > -Xp~/whereever/we/installed/compiler $* > Tried this and it seemed to work fine, for a while. A nasty side-effect is that the ~/whereever/we/installed/compiler dir comes first in looking for sources. Encountered the problem with a project that had a unit named tokens... Ludo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: RE : Re: RE : FPCUp FPC/Lazarusinstaller/updater: first Linux/Windows version released
On Sat, 18 Feb 2012 16:14:58 +0100 "Ludo Brands" wrote: > > > > You can use the "-Xp" option to specify a path for FPC to > > search for the > > ppc* binaries. > > > > E.g. > > > > #!/bin/sh > > ~/whereever/we/installed/fpc -n @~/whereever/we/installed/fpc.cfg > > -Xp~/whereever/we/installed/compiler $* > > > > Tried this and it seemed to work fine, for a while. A nasty side-effect is > that the ~/whereever/we/installed/compiler dir comes first in looking for > sources. Encountered the problem with a project that had a unit named > tokens... Yes. See Lazarus / View / IDE Internals / About FPC. The last path is always the one where the compiler is. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
RE : [fpc-pascal] Re: RE : Re: RE : FPCUpFPC/Lazarusinstaller/updater: first Linux/Windows version released
> > > You can use the "-Xp" option to specify a path for FPC to > > > search for the > > > ppc* binaries. > > > > > > E.g. > > > > > > #!/bin/sh > > > ~/whereever/we/installed/fpc -n @~/whereever/we/installed/fpc.cfg > > > -Xp~/whereever/we/installed/compiler $* > > > > > > > Tried this and it seemed to work fine, for a while. A nasty > > side-effect is that the ~/whereever/we/installed/compiler dir comes > > first in looking for sources. Encountered the problem with > a project > > that had a unit named tokens... > > Yes. See Lazarus / View / IDE Internals / About FPC. The last > path is always the one where the compiler is. > Looking at the fpc sources, I had already figured out that -Xp wasn't directly responsible and concluded that the compiler path was what caused the problem. The last path in a long list of unitpaths that contain only .o,.a and .ppu makes it still the first path containing sources... What is the rationale behind adding the compiler path to the search path for units and sources? Ludo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal