lib/debug/session.rb in debug-1.7.2 vs lib/debug/session.rb in debug-1.8.0

- old
+ new

@@ -1991,10 +1991,17 @@ end def after_fork_parent @ui.after_fork_parent end + + # experimental API + def extend_feature session: nil, thread_client: nil, ui: nil + Session.include session if session + ThreadClient.include thread_client if thread_client + @ui.extend ui if ui + end end class ProcessGroup def initialize @lock_file = nil @@ -2515,10 +2522,20 @@ end end module TrapInterceptor def trap sig, *command, &command_proc - case sig&.to_sym + sym = + case sig + when String + sig.to_sym + when Integer + Signal.signame(sig)&.to_sym + else + sig + end + + case sig&.to_s&.to_sym when :INT, :SIGINT if defined?(SESSION) && SESSION.active? && SESSION.intercept_trap_sigint? return SESSION.save_int_trap(command.empty? ? command_proc : command.first) end end