From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-04-14T00:14:24+09:00 Subject: Re: ruby_script() On Mon, 14 Apr 2003 00:25:49 +0900, ts wrote: >>>>>> "S" == Simon Strandgaard <0bz63fz3m1qt3001@sneakemail.com> writes: > > S> Is'nt "embed" supposed to be outputted in the backtrace? > > The backtrace are outputted for each frame created, when you write [snip] > ruby create a frame *only* for rb_require() (rb_laod(), none of the > commands ruby_init(), ruby_init_loadpath(), rb_protect() create a frame. I see.. only rb_require(). BTW what is a frame? Im writing a tutorial on embedding. The section on "initialization". What should I write: use ruby_script() it does something ? http://metaeditor.sourceforge.net/embed/ I tried rb_load() .. but I don't see "embed" in the backtrace, why ? > ./a.out hello from ./test.rb:2 ERROR # > cat main.cpp #include #include using namespace std; VALUE myfunc(VALUE) { //rb_require("test.rb", 0); rb_load(rb_str_new2("test.rb"), Qtrue); // no "embed" backtrace? return Qnil; } int main(int argc, char *argv[]) { ruby_init(); ruby_init_loadpath(); ruby_script("embed"); int error; rb_protect(myfunc, 0, &error); if(error) { VALUE err = rb_inspect(ruby_errinfo); rb_backtrace(); cout << "ERROR " << StringValuePtr(err) << endl; } return 0; } > cat test.rb puts "hello" raise "out" >