rgdb 0.0.1.245
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +676 -0
- data/ChangeLog +5 -0
- data/README +43 -0
- data/Rakefile +24 -0
- data/bin/rgdb +46 -0
- data/lib/gdb.rb +413 -0
- data/lib/rgdb.rb +75 -0
- data/lib/rgdb/version.rb +27 -0
- metadata +70 -0
data/lib/rgdb.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
#--
|
2
|
+
###############################################################################
|
3
|
+
# #
|
4
|
+
# rgdb -- GDB inside IRB #
|
5
|
+
# #
|
6
|
+
# Copyright (C) 2008 University of Cologne, #
|
7
|
+
# Albertus-Magnus-Platz, #
|
8
|
+
# 50932 Cologne, Germany #
|
9
|
+
# #
|
10
|
+
# Authors: #
|
11
|
+
# Jens Wille <jens.wille@uni-koeln.de> #
|
12
|
+
# #
|
13
|
+
# rgdb is free software; you can redistribute it and/or modify it under the #
|
14
|
+
# terms of the GNU General Public License as published by the Free Software #
|
15
|
+
# Foundation; either version 3 of the License, or (at your option) any later #
|
16
|
+
# version. #
|
17
|
+
# #
|
18
|
+
# rgdb is distributed in the hope that it will be useful, but WITHOUT ANY #
|
19
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
20
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more #
|
21
|
+
# details. #
|
22
|
+
# #
|
23
|
+
# You should have received a copy of the GNU General Public License along #
|
24
|
+
# with rgdb. If not, see <http://www.gnu.org/licenses/>. #
|
25
|
+
# #
|
26
|
+
###############################################################################
|
27
|
+
#++
|
28
|
+
|
29
|
+
require 'irb'
|
30
|
+
require 'gdb'
|
31
|
+
|
32
|
+
require 'rgdb/version'
|
33
|
+
|
34
|
+
module RGDB
|
35
|
+
|
36
|
+
extend self
|
37
|
+
|
38
|
+
def start(pid, ap_path)
|
39
|
+
pid = pid.to_i
|
40
|
+
|
41
|
+
if pid == Process.pid
|
42
|
+
puts "Can't attach to self: #{pid}"
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
46
|
+
begin
|
47
|
+
Process.getpgid(pid)
|
48
|
+
rescue Errno::ESRCH
|
49
|
+
puts "No such process: #{pid}"
|
50
|
+
return
|
51
|
+
end
|
52
|
+
|
53
|
+
puts "Attaching GDB to process id #{pid}"
|
54
|
+
workspace = IRB::WorkSpace.new(GDB::Ruby.new(pid))
|
55
|
+
|
56
|
+
# copied from IRB.start, but with workspace passed in
|
57
|
+
$0 = File.basename(ap_path, '.rb')
|
58
|
+
|
59
|
+
IRB.setup(ap_path)
|
60
|
+
|
61
|
+
irb = IRB::Irb.new(workspace, IRB.conf[:SCRIPT])
|
62
|
+
|
63
|
+
IRB.conf[:IRB_RC].call(irb.context) if IRB.conf[:IRB_RC]
|
64
|
+
IRB.conf[:MAIN_CONTEXT] = irb.context
|
65
|
+
|
66
|
+
trap('SIGINT') do
|
67
|
+
irb.signal_handle
|
68
|
+
end
|
69
|
+
|
70
|
+
catch(:IRB_EXIT) do
|
71
|
+
irb.eval_input
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
data/lib/rgdb/version.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
module RGDB
|
2
|
+
|
3
|
+
module Version
|
4
|
+
|
5
|
+
MAJOR = 0
|
6
|
+
MINOR = 0
|
7
|
+
TINY = 1
|
8
|
+
|
9
|
+
class << self
|
10
|
+
|
11
|
+
# Returns array representation.
|
12
|
+
def to_a
|
13
|
+
[MAJOR, MINOR, TINY]
|
14
|
+
end
|
15
|
+
|
16
|
+
# Short-cut for version string.
|
17
|
+
def to_s
|
18
|
+
to_a.join('.')
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
VERSION = Version.to_s
|
26
|
+
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rgdb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.245
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jens Wille
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-06-19 00:00:00 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: GDB inside IRB
|
17
|
+
email: jens.wille@uni-koeln.de
|
18
|
+
executables:
|
19
|
+
- rgdb
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- COPYING
|
24
|
+
- ChangeLog
|
25
|
+
- README
|
26
|
+
files:
|
27
|
+
- lib/gdb.rb
|
28
|
+
- lib/rgdb.rb
|
29
|
+
- lib/rgdb/version.rb
|
30
|
+
- bin/rgdb
|
31
|
+
- COPYING
|
32
|
+
- README
|
33
|
+
- ChangeLog
|
34
|
+
- Rakefile
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: http://prometheus.rubyforge.org/rgdb
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options:
|
39
|
+
- --all
|
40
|
+
- --line-numbers
|
41
|
+
- --main
|
42
|
+
- README
|
43
|
+
- --inline-source
|
44
|
+
- --title
|
45
|
+
- rgdb Application documentation
|
46
|
+
- --charset
|
47
|
+
- UTF-8
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
version:
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project: prometheus
|
65
|
+
rubygems_version: 1.1.1
|
66
|
+
signing_key:
|
67
|
+
specification_version: 2
|
68
|
+
summary: GDB inside IRB
|
69
|
+
test_files: []
|
70
|
+
|