summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw9766.pp
blob: 912683fff98aa8a5fa19cf1948c30f84a252a41d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ %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.