backtrace for mruby
C Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
README.md
mrbgem.rake

README.md

mruby-backtrace

Provide backtrace methods into mruby.

How to build


Edit your 'build_config.rb'.

mrbgem entry

conf.gem "/path/to/your/mruby-backtrace"

include paths (optional)

conf.cc do |cc|
  cc.include_paths << "/path/to/your/libunwind/libraries"
end

library settings

conf.linker do |linker|
  linker.libraries << %w(unwind unwind-#{target})
  linker.library_paths << "/path/to/your/libunwind/includes"
end

run make

$ make

How to use


Backtrace is changed the type from Class to Module.

module Backtrace

# put backtrace inside of RiteVM (display native C stack frames).
Backtrace.put_vm

# put backtrace inside of Ruby call stack.
Backtrace.put_rb

# get backtrace as string array like Ruby's Thread#backtrace.
Backtrace.backtrace