summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.mk7
-rwxr-xr-xtemplate/ruby-gdb.in6
-rwxr-xr-xtemplate/ruby-lldb.in6
-rwxr-xr-xtool/rbinstall.rb27
4 files changed, 43 insertions, 3 deletions
diff --git a/common.mk b/common.mk
index f36b5bb69e..937d6bf9bc 100644
--- a/common.mk
+++ b/common.mk
@@ -550,6 +550,13 @@ do-install-gem: $(PROGRAM) pre-install-gem
post-install-gem::
@$(NULLCMD)
+install-dbg: pre-install-dbg do-install-dbg post-install-dbg
+pre-install-dbg::
+do-install-dbg: $(PROGRAM) pre-install-dbg
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=dbg
+post-install-dbg::
+ @$(NULLCMD)
+
rdoc: PHONY main
@echo Generating RDoc documentation
$(Q) $(RDOC) --ri --op "$(RDOCOUT)" $(RDOC_GEN_OPTS) $(RDOCFLAGS) "$(srcdir)"
diff --git a/template/ruby-gdb.in b/template/ruby-gdb.in
new file mode 100755
index 0000000000..7ab4e976c6
--- /dev/null
+++ b/template/ruby-gdb.in
@@ -0,0 +1,6 @@
+#!/bin/sh
+prefix="/${0%/*}"
+prefix="${prefix%/*}"
+ruby="${bindir}/${RUBY_INSTALL_NAME}"
+gdbinit="${rubylibdir}/gdbinit"
+exec gdb --command="$gdbinit" --args "$ruby" "$@"
diff --git a/template/ruby-lldb.in b/template/ruby-lldb.in
new file mode 100755
index 0000000000..c33603b94d
--- /dev/null
+++ b/template/ruby-lldb.in
@@ -0,0 +1,6 @@
+#!/bin/sh
+prefix="/${0%/*}"
+prefix="${prefix%/*}"
+ruby="${bindir}/${RUBY_INSTALL_NAME}"
+lldbinit="${rubylibdir}/lldb_cruby.py"
+exec lldb -O "command script import $lldbinit" "$ruby" -- "$@"
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 7d7dbd55f3..aadfd41ef8 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -149,7 +149,9 @@ end
$install_procs = Hash.new {[]}
def install?(*types, &block)
- $install_procs[:all] <<= block
+ unless types.delete(:nodefault)
+ $install_procs[:all] <<= block
+ end
types.each do |type|
$install_procs[type] <<= block
end
@@ -482,7 +484,12 @@ _=_\\
=end
EOS
-installer = Struct.new(:ruby_shebang, :ruby_bin, :ruby_install_name, :stub, :trans)
+installer = Struct.new(:ruby_shebang, :ruby_bin, :ruby_install_name, :stub, :trans) do
+ def transform(name)
+ RbConfig.expand(trans[name])
+ end
+end
+
$script_installer = Class.new(installer) do
ruby_shebang = File.join(bindir, ruby_install_name)
if File::ALT_SEPARATOR
@@ -527,7 +534,7 @@ $script_installer = Class.new(installer) do
end
def install(src, cmd)
- cmd = cmd.sub(/[^\/]*\z/m) {|n| RbConfig.expand(trans[n])}
+ cmd = cmd.sub(/[^\/]*\z/m) {|n| transform(n)}
shebang, body = open(src, "rb") do |f|
next f.gets, f.read
@@ -655,6 +662,20 @@ install?(:local, :comm, :man) do
end
end
+install?(:dbg, :nodefault) do
+ prepare "debugger commands", bindir
+ prepare "debugger scripts", rubylibdir
+ conf = RbConfig::MAKEFILE_CONFIG.merge({"prefix"=>"${prefix#/}"})
+ Dir.glob(File.join(srcdir, "template/ruby-*db.in")) do |src|
+ cmd = $script_installer.transform(File.basename(src, ".in"))
+ open_for_install(File.join(bindir, cmd), $script_mode) {
+ RbConfig.expand(File.read(src), conf)
+ }
+ end
+ install File.join(srcdir, "misc/lldb_cruby.py"), File.join(rubylibdir, "lldb_cruby.py")
+ install File.join(srcdir, ".gdbinit"), File.join(rubylibdir, "gdbinit")
+end
+
module RbInstall
module Specs
class FileCollector