Method: Debugger::InfoCommand#info_program

Defined in:
lib/ruby-debug/commands/info.rb

#info_program(*args) ⇒ Object



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/ruby-debug/commands/info.rb', line 292

def info_program(*args)
  if not @state.context
    print "The program being debugged is not being run.\n"
    return
  elsif @state.context.dead? 
    print "The program crashed.\n"
    if Debugger.last_exception
      print("Exception: #{Debugger.last_exception.inspect}\n")
    end
    return
  end
  
  print "Program stopped. "
  case @state.context.stop_reason
  when :step
    print "It stopped after stepping, next'ing or initial start.\n"
  when :breakpoint
    print("It stopped at a breakpoint.\n")
  when :catchpoint
    print("It stopped at a catchpoint.\n")
  else
    print "unknown reason: %s\n" % @state.context.stop_reason.to_s
  end
end