From: Alex Fenton Date: 2007-07-13T05:15:00+09:00 Subject: Re: getting gdb backtrace from ruby exception Jano Svitok wrote: > On 7/12/07, Alex Fenton wrote: >> Is there any way I can get at the C stack at the point of ruby 'raise' >> from a C extension? > There was a way how to run ruby under gdb with the ability to debug at > "ruby level" while still having the "C view" at hand. > > http://eigenclass.org/hiki.rb?ruby+live+process+introspection > http://weblog.jamisbuck.org/2006/9/25/gdb-wrapper-for-ruby > http://redhanded.hobix.com/inspect/theRubyGdbArmsRaceNowAtAStandoff.html Thanks for the pointer - that's really interesting stuff. I got round it a bit more prosaically by simply setting a breakpoint in gdb where ruby calls the exception raising class (gdb) b rb_exc_raise Breakpoint 1, rb_exc_raise (mesg=3057353380) at eval.c:4583 4583 rb_longjmp(TAG_RAISE, mesg); (gdb) whe .... tasty stacktrace cheers alex