develooper Front page | perl.perl5.porters | Postings from September 2023

Re: Native stack traces?

Thread Previous | Thread Next
September 8, 2023 13:02
Re: Native stack traces?
Message ID:
On Fri, 8 Sept 2023 at 14:56, Felipe Gasper via perl5-porters <> wrote:

> > On Sep 8, 2023, at 08:54, Christian Walde <>
> wrote:
> >
> > ´╗┐On Fri, 08 Sep 2023 12:56:00 +0200, Dave Mitchell <>
> wrote:
> >
> >>> On Fri, Sep 08, 2023 at 12:24:58PM +0200, Ovid wrote:
> >>> I don't know if a native stack trace implemented in the Perl core would
> >>> solve the problems, but if we were to add "official" stack traces in
> the
> >>> core, allowing people to pass a callback or frame subclass for
> filtering, I
> >>> think this would be a benefit.
> >>>
> >>> If we later want to add a native exception system, native stack traces
> >>> would likely be a prerequisite.
> >>
> >> I'm not really sure in this context what you consider to be a "native"
> >> stack trace which isn't already provided by perl?
> >>
> >> Carp and Devel::StackTrace are just wrappers of varying heaviness around
> >> perl's built-in call stack introspection facility: caller() and
> @DB::args.
> >>
> >> ...
> >>
> >> What else would you want perl to natively provide?
> >
> > i think what ovid is getting at that there could be value in moderately
> configurable stacktrace generators implemented in the perl c core, with the
> hope that those could be considerably faster than the only current way of
> getting the data out of the internals, then munging it at the perl level
> >
> > no idea if that would actually bear out, but that's my understanding
> Would an XS module provide comparable functionality?

Yeah, this could be implemented as an XS module.

I think the problem with this kind of request is that there are an awful
lot of possible options that could be applied. Do you show arguments or
not? If you do, do you show the raw value or do you filter them, or do you
transform them to show type only, etc. Do you show hints flags? Do you show
the file and line? Do you munge the filename? Do you show the full stack?
Do you not?  How do you interoperate with eval, etc. It turns out that
there are lot of options there...


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About