Skip to main content

PerlStackParser

Struct PerlStackParser 

Source
pub struct PerlStackParser { /* private fields */ }
Expand description

Parser for Perl debugger stack trace output.

This parser converts text output from the Perl debugger’s stack trace commands (T, y, etc.) into structured StackFrame representations.

Implementations§

Source§

impl PerlStackParser

Source

pub fn new() -> Self

Creates a new stack parser with default settings.

Source

pub fn with_unknown_frames(self, include: bool) -> Self

Sets whether to include frames with no source location.

Source

pub fn with_auto_ids(self, auto: bool) -> Self

Sets whether to auto-assign frame IDs.

Source

pub fn with_starting_id(self, id: i64) -> Self

Sets the starting ID for auto-assignment.

Source

pub fn parse_frame(&mut self, line: &str, id: i64) -> Option<StackFrame>

Parses a single stack frame line.

§Arguments
  • line - A line from stack trace output
  • id - The frame ID to assign (ignored if auto_assign_ids is true)
§Returns

A parsed StackFrame if the line matches a known format.

Source

pub fn parse_stack_trace(&mut self, output: &str) -> Vec<StackFrame>

Parses multi-line stack trace output.

§Arguments
  • output - Multi-line debugger output from ‘T’ command
§Returns

A vector of parsed stack frames, ordered from innermost to outermost.

Source

pub fn parse_context(&self, line: &str) -> Option<(String, String, i64)>

Parses context information from a debugger prompt line.

This is useful for determining the current execution position from the debugger’s status output.

§Arguments
  • line - A line containing context information
§Returns

A tuple of (function, file, line) if parsed successfully.

Source

pub fn looks_like_frame(line: &str) -> bool

Determines if a line looks like a stack frame.

This can be used for filtering lines before full parsing.

Trait Implementations§

Source§

impl Debug for PerlStackParser

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PerlStackParser

Source§

fn default() -> PerlStackParser

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.