Skip to content

inspect var param #3

@User4martin

Description

@User4martin

break on line 14 (the 2nd assignment for "a.x" / a dummy line for the breakpoint)

pdr) inspect n
[INSPECT] n: TFoo (class, 8 bytes)
[INSPECT] parent chain: TFoo -> TObject
[INSPECT] fields (2):
s = 'abc'     [UnicodeString(1200), offset +16]
x = 'def'     [AnsiString(0), offset +24]
(pdr) inspect a
[INSPECT] a: TFoo (class, 8 bytes)
[INSPECT] parent chain: TFoo -> TObject
[INSPECT] fields (2):
s = ''     [UnicodeString(1200), offset +16]
x = ''     [AnsiString(0), offset +24]

It should show the values for the 2 strings.

Remove the var from the param, and "a" can be inspected.

program project1;
type
  TFoo = class
    public var s: WideString;
    public x: AnsiString
  end;
  TFooClass = class of TFoo;

procedure Bar(var a: TFoo; b: TFooClass);
begin
  a:= b.Create;
  a.s:='abc';
  a.x:='def';
  a.x:='def';b
end;

var
n: TFoo;
begin
  Bar(n, TFoo);
end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions