The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Parse::StackTrace::Frame - A single frame (containing a single function) from a stack trace.

SYNOPSIS

 my $frame = $thread->frame_number(0);
 
 my $function = $frame->function;
 my $arguments = $frame->args;
 my $number = $frame->number;
 my $file_name = $frame->file;
 my $file_line = $frame->line;

DESCRIPTION

Represents a single frame in a stack trace. A frame represents a single function call in a stack trace. A frame can also contains other information, like what arguments were passed to the function, or what code file the frame's function is in.

Usually you get a frame by accessing "frames" in Parse::StackTrace::Thread or calling "frame_number" in Parse::StackTrace::Thread, or using one of the other methods in Parse::StackTrace::Thread that returns a frame.

ACCESSORS

These are methods that take no arguments and just return information.

Only "function" will always have a value. The other attributes are all optional and may return undef if they have not been specified.

function

The name of the function that was called in this trace. We return it just as its written in the stack trace, so we can't guarantee anything about the format.

args

A string representing the arguments that were passed to the function.

number

What number frame this was in the stack trace.

file

The name of the file that the code of this function lives in. (This will be the source file, not the binary file, for languages that differentiate between those two things.) This may be the full path to the file, or just the file name.

line

The line number in "file" where this function was called.

code

The actual code on that line of that file.

is_crash

True if this is the frame where we crashed. For example, in a GDB trace, is_crash true if this is the frame where the signal handler was called.

SEE ALSO

You may also want to read the documentation for the specific implementations of Frame for the various types of stack traces that we parse, because they might have more methods that aren't available in the generic Frame:

Parse::StackTrace::Type::GDB::Frame
Parse::StackTrace::Type::Python::Frame