From: Detlef Reichl Date: 2007-07-12T23:27:29+09:00 Subject: Re: getting gdb backtrace from ruby exception Hi, i don't know how to build stack traces, but you can start ruby in gdb. first call gdb with ruby as argument. On liux it looks like: det@datengrab:~/Desktop$ gdb /usr/bin/ruby and then in gdb start your ruby program with "run" (gdb) run ./my-prg.rb Cheers detlef Am Donnerstag, den 12.07.2007, 23:10 +0900 schrieb Alex Fenton: > Hi > > I'm working on a C extension and somewhere in itsomething is raising a > NoMethodError. The exception is reported with the line of ruby code that > triggered the bad call in the C extension. > > As the C code is large and complex (it's a big SWIG project), I'm having > trouble finding the problem in the C code. I would use gdb or > Microsoft's debugger to look at the stack if it was a C error - but when > a Ruby exception is raised, the process exits and there's no stack to > inspect. > > Ruby's debugger isn't helpful because it only knows about ruby written > in ruby. > > Is there any way I can get at the C stack at the point of ruby 'raise' > >from a C extension? > > Thanks > alex