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.