mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 21:48:09 +02:00

class in case the parent class has a field with as type the (forward defined) child class, because this crashes gdb + (interactive) test for this git-svn-id: trunk@8565 -
45 lines
893 B
ObjectPascal
45 lines
893 B
ObjectPascal
{ %interactive }
|
|
|
|
{ instructions: set a breakpoint on PASCALMAIN, then step into }
|
|
{ TChild.Create(nil). This shouldn't crash gdb }
|
|
|
|
{$mode delphi}
|
|
|
|
type
|
|
// swap the order of these declarations (TParent & TChild) and the problem is fixed.
|
|
TParent = class;
|
|
TChild = class;
|
|
|
|
TParent = class
|
|
private
|
|
FChild : TChild; // remove me and the problem is fixed.
|
|
public
|
|
constructor Create ( AOwner : pointer ); virtual;
|
|
end;
|
|
|
|
TChild = class(TParent)
|
|
private
|
|
FField : Integer; // remove me and the problem is fixed.
|
|
public
|
|
constructor Create ( AOwner : pointer ); override;
|
|
end;
|
|
|
|
{ TParent }
|
|
|
|
constructor TParent.Create(AOwner: pointer);
|
|
begin
|
|
Inherited Create;
|
|
end;
|
|
|
|
{ TChild }
|
|
|
|
constructor TChild.Create(AOwner: pointer);
|
|
begin
|
|
Inherited;
|
|
end;
|
|
|
|
|
|
begin
|
|
TChild.Create(nil); // break-point here and try to step into constructor (gdb/stabs)
|
|
end.
|