Skip to content

Commit cae522a

Browse files
committed
allow disabling of int handler
1 parent d83e56d commit cae522a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/rdebug-ide

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ options = OpenStruct.new(
2525
'load_mode' => false,
2626
'port' => 1234,
2727
'stop' => false,
28-
'tracing' => false
28+
'tracing' => false,
29+
'int_handler' => true
2930
)
3031

3132
opts = OptionParser.new do |opts|
@@ -52,6 +53,7 @@ EOB
5253
end
5354

5455
opts.on("--keep-frame-binding", "Keep frame bindings") {options.frame_bind = true}
56+
opts.on("--disable-int-handler", "Disables interrupt signal handler") {options.int_handler = false}
5557
opts.separator ""
5658
opts.separator "Common options:"
5759
opts.on_tail("-v", "--version", "Show version") do
@@ -85,8 +87,11 @@ end
8587
# save script name
8688
Debugger::PROG_SCRIPT = ARGV.shift
8789

88-
# install interruption handler
89-
trap('INT') { Debugger.interrupt_last }
90+
91+
if options.int_handler
92+
# install interruption handler
93+
trap('INT') { Debugger.interrupt_last }
94+
end
9095

9196
# set options
9297
Debugger.keep_frame_binding = options.frame_bind

0 commit comments

Comments
 (0)