class Backtrace::Frame { }

A single backtrace frame. It identifies a location in the source code.

Methods§

method file§

method file(Backtrace::Frame:D --> Str)

Returns the file name.

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.file;

method line§

method line(Backtrace::Frame:D --> Int)

Returns the line number (line numbers start counting from 1).

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.line;

method code§

method code(Backtrace::Frame:D)

Returns the code object into which .file and .line point, if available.

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.code;

method subname§

method subname(Backtrace::Frame:D --> Str)

Returns the name of the enclosing subroutine.

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.subname;

method is-hidden§

method is-hidden(Backtrace::Frame:D: --> Bool:D)

Returns True if the frame is marked as hidden with the is hidden-from-backtrace trait.

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.is-hidden;

method is-routine§

method is-routine(Backtrace::Frame:D: --> Bool:D)

Return True if the frame points into a routine (and not into a mere Block).

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.is-routine;

method is-setting§

method is-setting(Backtrace::Frame:D: --> Bool:D)

Returns True if the frame is part of a setting.

my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.is-setting# OUTPUT: «True␤»