Debugging extensions with gdb

I know this is slightly off-topic, since it’s really more of a gdb
question than a ruby question. My appologies.

I need to place a breakpoint in a Ruby extension. I can’t do this
before the program runs, because the extension hasn’t yet been loaded.
So I’m currently doing this by:

  1. b main
  2. run
  3. b rb_f_require
  4. c
  5. When the program breaks in rb_f_require, continue until I hit the
    dln_load call.
  6. Place my breakpoint at the appropriate place in the extension.

Something tells me, though, that there must be a better way to do this.
Any ideas?

Thanks,

Paul

Something tells me, though, that there must be a better way to do this.
Any ideas?

put a breakpoint in dln_load

see [ruby-talk:18105]

You don't need to re-enable your breakpoint with some versions of gdb

Guy Decoux