Struct Frame

Represents a stack frame

struct Frame;

Fields

NameTypeDescription
address string
file string
index int
invalid bool
line int
moduleName string
name string
offset string
raw string

Example

The frame should convert a frame to string

Frame(10, "some.module", "0xffffff", "name", "offset", "file.d", 120).toString.should.equal(
  `10  0xffffff name at some.module + offset (file.d:120)`
);

Example

The frame should not output an index < 0 or a line < 0

Frame(-1, "some.module", "0xffffff", "name", "offset", "file.d", -1).toString.should.equal(
  `0xffffff name at some.module + offset (file.d)`
);

Example

The frame should not output the file if it is missing from the stack

Frame(-1, "some.module", "0xffffff", "name", "offset", "", 10).toString.should.equal(
  `0xffffff name at some.module + offset`
);

Example

The frame should not output the module if it is missing from the stack

Frame(-1, "", "0xffffff", "name", "offset", "", 10).toString.should.equal(
  `0xffffff name + offset`
);

Example

The frame should not output the offset if it is missing from the stack

Frame(-1, "", "0xffffff", "name", "", "", 10).toString.should.equal(
  `0xffffff name`
);

Example

The frame should display ???? when the name is missing

Frame(-1, "", "0xffffff", "", "", "", 10).toString.should.equal(
  `0xffffff ????`
);