Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-06

ExceptAddr, but no ExceptFrameCount and ExceptFrames

9 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

Hi,

Sysutil has a function ExceptAddr to current exception address, but no corresponding functions to get the frame count and the frames of the current exception.

Are these function just not yet implemented or are the ommitted on purpose?

Regards,
Vincent Snijders.

Reply by email

Michael Van Canneyt
to Vincent Snijders
Vincent Snijders wrote 7 lines
Hi, Sysutil has a function ExceptAddr to current exception address, but no corresponding functions to get the frame count and the frames of the current exception. Are these function just not yet implemented or are the ommitted on purpose?

Just not yet implemented. Delphi didn't have them either.

Michael.

Reply by email

Vincent Snijders
to Michael Van Canneyt
Michael Van Canneyt wrote 16 lines
On Tue, 21 Jun 2005, Vincent Snijders wrote: > Hi, > > Sysutil has a function ExceptAddr to current exception address, but no > corresponding functions to get the frame count and the frames of the > current exception. > > Are these function just not yet implemented or are the ommitted on > purpose? Just not yet implemented. Delphi didn't have them either.

OK, a patch will follow soon.

Vincent.

Reply by email

Vincent Snijders
to Vincent Snijders
Vincent Snijders wrote 20 lines
Michael Van Canneyt wrote: > > > On Tue, 21 Jun 2005, Vincent Snijders wrote: > >> Hi, >> >> Sysutil has a function ExceptAddr to current exception address, but >> no corresponding functions to get the frame count and the frames of >> the current exception. >> >> Are these function just not yet implemented or are the ommitted on >> purpose? > > > > Just not yet implemented. Delphi didn't have them either. >

Attached are two patches:
1. except.patch implements ExceptFrameCount and ExceptFrames
2. arg.patch fixes a bug in the copying of the commandfilename to the arg array. The #0 character was not copied, so the pchar was not properly terminated.

If these patches are applied in the trunk, wil they be merged into the fixes branch too?

Vincent.

Reply by email

Florian Klaempfl
to Vincent Snijders
Vincent Snijders wrote 32 lines
Vincent Snijders wrote: > Michael Van Canneyt wrote: > >> >> >> On Tue, 21 Jun 2005, Vincent Snijders wrote: >> >>> Hi, >>> >>> Sysutil has a function ExceptAddr to current exception address, but >>> no corresponding functions to get the frame count and the frames of >>> the current exception. >>> >>> Are these function just not yet implemented or are the ommitted on >>> purpose? >> >> >> >> >> Just not yet implemented. Delphi didn't have them either. >> > Attached are two patches: 1. except.patch implements ExceptFrameCount and ExceptFrames 2. arg.patch fixes a bug in the copying of the commandfilename to the arg array. The #0 character was not copied, so the pchar was not properly terminated. If these patches are applied in the trunk, wil they be merged into the fixes branch too?

If we should do so ;)

Show quoted text 65 lines
Vincent. ------------------------------------------------------------------------ Index: sysutilh.inc =================================================================== --- sysutilh.inc (revision 460) +++ sysutilh.inc (working copy) @@ -156,6 +156,8 @@ { Exception handling routines } function ExceptObject: TObject; function ExceptAddr: Pointer; + function ExceptFrameCount: Longint; + function ExceptFrames: PPointer; function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer; Buffer: PChar; Size: Integer): Integer; procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer); Index: sysutils.inc =================================================================== --- sysutils.inc (revision 460) +++ sysutils.inc (working copy) @@ -362,6 +362,24 @@ Result:=RaiseList^.Addr; end; +function ExceptFrameCount: Longint; + +begin + If RaiseList=Nil then + Result:=0 + else + Result:=RaiseList^.Framecount; +end; + +function ExceptFrames: PPointer; + +begin + If RaiseList=Nil then + Result:=Nil + else + Result:=RaiseList^.Frames; +end; + function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer; Buffer: PChar; Size: Integer): Integer; ------------------------------------------------------------------------ Index: system.pp =================================================================== --- system.pp (revision 460) +++ system.pp (working copy) @@ -177,7 +177,7 @@ Inc(Arglen); until (pc[Arglen]=#0); allocarg(count,arglen); - move(pc^,argv[count]^,arglen); + move(pc^,argv[count]^,arglen+1); { Setup cmdline variable } cmdline:=GetCommandLine; { process arguments }

Applying to which path, i.e. OS :)?

Reply by email

Vincent Snijders
to Vincent Snijders: Attached are two patches: 1. except.patch implements ExceptFrameCount and ExceptFrames 2.…
Vincent Snijders wrote
Vincent Snijders wrote:

I noticed that tortoisesvn doesn't put a full path into the diff like tortoisecvs did.

Attached are two patches: 1. except.patch implements ExceptFrameCount and ExceptFrames

This patch is taken from the rtl/objpas/sysutils directory.

2. arg.patch fixes a bug in the copying of the commandfilename to the arg array. The #0 character was not copied, so the pchar was not properly terminated.

This patch is for rtl/win32/system.pp

Vincent.

Reply by email

Florian Klaempfl
to Vincent Snijders: Attached are two patches: 1. except.patch implements ExceptFrameCount and ExceptFrames 2.…
Vincent Snijders wrote 33 lines
Vincent Snijders wrote: > Michael Van Canneyt wrote: > >> >> >> On Tue, 21 Jun 2005, Vincent Snijders wrote: >> >>> Hi, >>> >>> Sysutil has a function ExceptAddr to current exception address, but >>> no corresponding functions to get the frame count and the frames of >>> the current exception. >>> >>> Are these function just not yet implemented or are the ommitted on >>> purpose? >> >> >> >> >> Just not yet implemented. Delphi didn't have them either. >> > Attached are two patches: 1. except.patch implements ExceptFrameCount and ExceptFrames 2. arg.patch fixes a bug in the copying of the commandfilename to the arg array. The #0 character was not copied, so the pchar was not properly terminated. If these patches are applied in the trunk, wil they be merged into the fixes branch too?

Applied, I'll merge them too.

Reply by email

Vincent Snijders
to Florian Klaempfl: Applied, I'll merge them too.
Florian Klaempfl wrote 8 lines
Vincent Snijders wrote: > >If these patches are applied in the trunk, wil they be merged into the >fixes branch too? > Applied, I'll merge them too.

I think there was a typo in the merge command. Revision 361 was merged and not revision 461.
From the logfile:
2005-06-21 14:01 florian r462

/branches/: fixes_2_0

Merged revisions 361 via svnmerge from
/trunk

2005-06-21 12:55 florian r461

/trunk/rtl/:
objpas/sysutils/: sysutilh.inc, sysutils.inc
win32/: system.pp

* Patch from Vincent Snijders:

Vincent.

Reply by email