Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • This post may be of interest to you: []

    Be sure to follow the comments, too.

    • Ah, gleaning the information from backtrace() is nicer than using rb_eval() which would be my normal first pass trick. That is, in any language like Perl, Ruby, or I assume Python, if there's a C API that exposes an eval() function, you can get enormous powers just by driving eval() from gdb.

      FWIW and because I the blog software comments aren't working for me, the clean bit of fu to glark the call stack is packaged as a GDB function thusly:

      define ruby_backtrace
        set $ary = (struct RArray)backtrace(-1)
        set $count = (long)($ary->len)
        set $index = (long)0
        while    $index < $count
          set    $str = (struct RString)rb_ary_entry($ary, $index)
          set    $ptr = (char*)($str->ptr)
          x/1s *$ptr
          set    $index = (long)($index + 1)


      This still misses the point since what I originally complained of, the arguments to the functions are *still* missing and for exactly the same reasons.