Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

inspecting Perl call stack from inside a XS subroutine?

by bubnikv (Novice)
on Aug 23, 2016 at 22:47 UTC ( [id://1170263]=perlquestion: print w/replies, xml ) Need Help??

bubnikv has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks. I am taking part on a bigger Perl/C++ project. I managed to compile the Perl interpreter and everything related with Visual Studio C++ on Windows and I can now debug the XS/C++ part wonderfully. Now I would love to inspect the Perl call stack calling the XS routine, when I break in the C++ code. Is there any way to inspect the Perl internal structures using the C++ debugger to get the Perl call stack? Or maybe I can execute some Perl routine from inside the XS C++ code to get the Perl call stack? Thanks, Vojtech
  • Comment on inspecting Perl call stack from inside a XS subroutine?

Replies are listed 'Best First'.
Re: inspecting Perl call stack from inside a XS subroutine?
by Marshall (Canon) on Aug 23, 2016 at 23:33 UTC
    I don't know if this will help or not, but caller is Perl sub that can do a lot.
Re: inspecting Perl call stack from inside a XS subroutine?
by dcmertens (Scribe) on Aug 24, 2016 at 14:39 UTC
    A quick search through perlapi led me to caller_cx. I am really not sure how to "interrogate a Perl context" structure, but perlguts seems to have some useful information in this regard. Since you're probably more familiar with the Perl-level caller function, it might just be easier to call that directly. See perlcall for help there.
      Thanks, I could probably call a perl function from the Visual Studio debugger, this seems to be the easiest to do.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1170263]
Approved by stevieb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 01:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found