Permalink
Browse files

Add rubinius::warn(msg)

  • Loading branch information...
1 parent aff2695 commit 2ad86215ebd8ff52823ebc625818b5b36f0240a5 @evanphx evanphx committed Oct 20, 2011
Showing with 6 additions and 0 deletions.
  1. +1 −0 vm/bug.hpp
  2. +5 −0 vm/exception.cpp
View
@@ -5,6 +5,7 @@ namespace rubinius {
void abort();
void bug(const char* message);
void bug(const char* message, const char* arg);
+ void warn(const char* message);
void print_backtrace(size_t max=100);
}
View
@@ -132,6 +132,11 @@ namespace rubinius {
::abort();
}
+ void warn(const char* message) {
+ std::cerr << "[WARNING: " << message << "]\n";
+ print_backtrace();
+ }
+
void print_backtrace(size_t max) {
VMException::Backtrace s = get_trace(2, max);
demangle(s);

0 comments on commit 2ad8621

Please sign in to comment.