Added install-dbg
Scripts to run the interpreter via debugger.
This commit is contained in:
parent
eabdad5e2f
commit
1f1b62fb7b
@ -550,6 +550,13 @@ do-install-gem: $(PROGRAM) pre-install-gem
|
|||||||
post-install-gem::
|
post-install-gem::
|
||||||
@$(NULLCMD)
|
@$(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
|
rdoc: PHONY main
|
||||||
@echo Generating RDoc documentation
|
@echo Generating RDoc documentation
|
||||||
$(Q) $(RDOC) --ri --op "$(RDOCOUT)" $(RDOC_GEN_OPTS) $(RDOCFLAGS) "$(srcdir)"
|
$(Q) $(RDOC) --ri --op "$(RDOCOUT)" $(RDOC_GEN_OPTS) $(RDOCFLAGS) "$(srcdir)"
|
||||||
|
6
template/ruby-gdb.in
Executable file
6
template/ruby-gdb.in
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
prefix="/${0%/*}"
|
||||||
|
prefix="${prefix%/*}"
|
||||||
|
ruby="${bindir}/${RUBY_INSTALL_NAME}"
|
||||||
|
gdbinit="${rubylibdir}/gdbinit"
|
||||||
|
exec gdb --command="$gdbinit" --args "$ruby" "$@"
|
6
template/ruby-lldb.in
Executable file
6
template/ruby-lldb.in
Executable file
@ -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" -- "$@"
|
@ -149,7 +149,9 @@ end
|
|||||||
|
|
||||||
$install_procs = Hash.new {[]}
|
$install_procs = Hash.new {[]}
|
||||||
def install?(*types, &block)
|
def install?(*types, &block)
|
||||||
$install_procs[:all] <<= block
|
unless types.delete(:nodefault)
|
||||||
|
$install_procs[:all] <<= block
|
||||||
|
end
|
||||||
types.each do |type|
|
types.each do |type|
|
||||||
$install_procs[type] <<= block
|
$install_procs[type] <<= block
|
||||||
end
|
end
|
||||||
@ -482,7 +484,12 @@ _=_\\
|
|||||||
=end
|
=end
|
||||||
EOS
|
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
|
$script_installer = Class.new(installer) do
|
||||||
ruby_shebang = File.join(bindir, ruby_install_name)
|
ruby_shebang = File.join(bindir, ruby_install_name)
|
||||||
if File::ALT_SEPARATOR
|
if File::ALT_SEPARATOR
|
||||||
@ -527,7 +534,7 @@ $script_installer = Class.new(installer) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def install(src, cmd)
|
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|
|
shebang, body = open(src, "rb") do |f|
|
||||||
next f.gets, f.read
|
next f.gets, f.read
|
||||||
@ -655,6 +662,20 @@ install?(:local, :comm, :man) do
|
|||||||
end
|
end
|
||||||
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 RbInstall
|
||||||
module Specs
|
module Specs
|
||||||
class FileCollector
|
class FileCollector
|
||||||
|
Loading…
x
Reference in New Issue
Block a user