aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 11:21:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 11:21:09 +0000
commit25dc32bc87339358553449640bf99a443f1908ac (patch)
treec3b466e9b947ce202df20a29f0d4b7cf96fc13e3
parent8eb2e6c14a8fcf3719fbdb82141aae5363e507b4 (diff)
downloadruby-25dc32bc87339358553449640bf99a443f1908ac.tar.gz
tool/runruby.rb: fix RUNRUBY_USE_GDB case
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rwxr-xr-xtool/runruby.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/runruby.rb b/tool/runruby.rb
index 662c0aef35..a5aa3e7d8d 100755
--- a/tool/runruby.rb
+++ b/tool/runruby.rb
@@ -131,7 +131,7 @@ end
ENV.update env
if debugger or ENV['RUNRUBY_USE_GDB'] == 'true'
- if debugger == :gdb
+ if debugger == :gdb or !debugger
debugger = %w'gdb'
if File.exist?(gdb = 'run.gdb') or
File.exist?(gdb = File.join(abs_archdir, 'run.gdb'))
@@ -139,7 +139,11 @@ if debugger or ENV['RUNRUBY_USE_GDB'] == 'true'
end
debugger << '--args'
end
- precommand[precommand.index(:debugger), 1] = debugger
+ if idx = precommand.index(:debugger)
+ precommand[idx, 1] = debugger
+ else
+ precommand.concat(debugger)
+ end
end
cmd = [runner || ruby]