summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-11-04 20:40:21 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-11-04 20:40:21 +0000
commit27760029531ddcdf22dabf783e03c7baeb554840 (patch)
tree546506cc0c2c38bccc3c638afcc4fc7efa6e6b87
parent35f408c64b77df7c1eda05b5a2bfc073039b3b25 (diff)
downloadfpc-27760029531ddcdf22dabf783e03c7baeb554840.tar.gz
* pass not only exception address but also frame to raise:
if an address is passed the compiler cannot know a good value for the frame so it passed nil and no stack trace is printed, resolves #12528 git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@22932 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/fcl-base/src/contnrs.pp2
-rw-r--r--packages/fcl-xml/src/xpath.pp8
-rw-r--r--rtl/objpas/classes/bits.inc6
-rw-r--r--rtl/objpas/classes/lists.inc4
-rw-r--r--rtl/objpas/classes/streams.inc6
-rw-r--r--rtl/objpas/classes/stringl.inc4
-rw-r--r--rtl/objpas/fgl.pp2
7 files changed, 15 insertions, 17 deletions
diff --git a/packages/fcl-base/src/contnrs.pp b/packages/fcl-base/src/contnrs.pp
index cdc3d266bd..cdec26f764 100644
--- a/packages/fcl-base/src/contnrs.pp
+++ b/packages/fcl-base/src/contnrs.pp
@@ -1403,7 +1403,7 @@ end;
class procedure TFPHashList.Error(const Msg: string; Data: PtrInt);
begin
- Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
+ Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
function TFPHashList.Expand: TFPHashList;
diff --git a/packages/fcl-xml/src/xpath.pp b/packages/fcl-xml/src/xpath.pp
index 60a892fc23..76cc2cf6c8 100644
--- a/packages/fcl-xml/src/xpath.pp
+++ b/packages/fcl-xml/src/xpath.pp
@@ -1342,13 +1342,13 @@ end;
procedure EvaluationError(const Msg: String);
begin
- raise EXPathEvaluationError.Create(Msg) at get_caller_addr(get_frame);
+ raise EXPathEvaluationError.Create(Msg) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure EvaluationError(const Msg: String; const Args: array of const);
begin
raise EXPathEvaluationError.CreateFmt(Msg, Args)
- at get_caller_addr(get_frame);
+ at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
@@ -1370,7 +1370,7 @@ end;
procedure TXPathVariable.Error(const Msg: String; const Args: array of const);
begin
- raise Exception.CreateFmt(Msg, Args) at get_caller_addr(get_frame);
+ raise Exception.CreateFmt(Msg, Args) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
@@ -1788,7 +1788,7 @@ end;
procedure TXPathScanner.Error(const Msg: String);
begin
- raise Exception.Create(Msg) at get_caller_addr(get_frame);
+ raise Exception.Create(Msg) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure TXPathScanner.ParsePredicates(var Dest: TXPathNodeArray);
diff --git a/rtl/objpas/classes/bits.inc b/rtl/objpas/classes/bits.inc
index b8136c2161..ed050fe742 100644
--- a/rtl/objpas/classes/bits.inc
+++ b/rtl/objpas/classes/bits.inc
@@ -15,15 +15,13 @@
{****************************************************************************}
Procedure BitsError (const Msg : string);
-
begin
- Raise EBitsError.Create(Msg) at get_caller_addr(get_frame);
+ Raise EBitsError.Create(Msg) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
Procedure BitsErrorFmt (const Msg : string; const Args : array of const);
-
begin
- Raise EBitsError.CreateFmt(Msg,args) at get_caller_addr(get_frame);
+ Raise EBitsError.CreateFmt(Msg,args) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
{Min function for Longint}
diff --git a/rtl/objpas/classes/lists.inc b/rtl/objpas/classes/lists.inc
index afcbe65c3d..e20a018f61 100644
--- a/rtl/objpas/classes/lists.inc
+++ b/rtl/objpas/classes/lists.inc
@@ -154,7 +154,7 @@ end;
class procedure TFPList.Error(const Msg: string; Data: PtrInt);
begin
- Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
+ Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure TFPList.Exchange(Index1, Index2: Integer);
@@ -743,7 +743,7 @@ end;
class procedure TList.Error(const Msg: string; Data: PtrInt);
begin
- Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
+ Raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure TList.Exchange(Index1, Index2: Integer);
diff --git a/rtl/objpas/classes/streams.inc b/rtl/objpas/classes/streams.inc
index b1e52f71bc..c23734e0eb 100644
--- a/rtl/objpas/classes/streams.inc
+++ b/rtl/objpas/classes/streams.inc
@@ -16,12 +16,12 @@
procedure TStream.ReadNotImplemented;
begin
- raise EStreamError.CreateFmt(SStreamNoReading, [ClassName]) at get_caller_addr(get_frame);
+ raise EStreamError.CreateFmt(SStreamNoReading, [ClassName]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure TStream.WriteNotImplemented;
begin
- raise EStreamError.CreateFmt(SStreamNoWriting, [ClassName]) at get_caller_addr(get_frame);
+ raise EStreamError.CreateFmt(SStreamNoWriting, [ClassName]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
function TStream.Read(var Buffer; Count: Longint): Longint;
@@ -154,7 +154,7 @@ end;
procedure TStream.InvalidSeek;
begin
- raise EStreamError.CreateFmt(SStreamInvalidSeek, [ClassName]) at get_caller_addr(get_frame);
+ raise EStreamError.CreateFmt(SStreamInvalidSeek, [ClassName]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure TStream.FakeSeekForward(Offset: Int64; const Origin: TSeekOrigin; const Pos: Int64);
diff --git a/rtl/objpas/classes/stringl.inc b/rtl/objpas/classes/stringl.inc
index e16b7f1b94..a246b17646 100644
--- a/rtl/objpas/classes/stringl.inc
+++ b/rtl/objpas/classes/stringl.inc
@@ -434,13 +434,13 @@ end;
Procedure TStrings.Error(const Msg: string; Data: Integer);
begin
- Raise EStringListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
+ Raise EStringListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
Procedure TStrings.Error(const Msg: pstring; Data: Integer);
begin
- Raise EStringListError.CreateFmt(Msg^,[Data]) at get_caller_addr(get_frame);
+ Raise EStringListError.CreateFmt(Msg^,[Data]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
diff --git a/rtl/objpas/fgl.pp b/rtl/objpas/fgl.pp
index 0b6670334f..3957bcc404 100644
--- a/rtl/objpas/fgl.pp
+++ b/rtl/objpas/fgl.pp
@@ -526,7 +526,7 @@ end;
class procedure TFPSList.Error(const Msg: string; Data: PtrInt);
begin
- raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame);
+ raise EListError.CreateFmt(Msg,[Data]) at get_caller_addr(get_frame), get_caller_frame(get_frame);
end;
procedure TFPSList.Exchange(Index1, Index2: Integer);