crash-watch 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.asc +7 -7
- data/Rakefile +1 -1
- data/bin/crash-watch +5 -6
- data/lib/crash_watch/gdb_controller.rb +64 -12
- data/lib/crash_watch/version.rb +1 -1
- metadata +2 -2
- metadata.gz.asc +7 -7
data.tar.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJRoN3dAAoJECrHRaUKISqMtOUH/R3vYMTrTqNcqd02b9UJPERb
|
6
|
+
G+kYMIND2e4zoGbsIUL+WcFohf3PphAyh0VQLW71T6e1k9O1mBNaleuU95ephruQ
|
7
|
+
gfzA/dzcKk3dHD7xQTRm1MKJZS5b/zCowq1DSw9oPYl60tcTDELzw6G6DF1Kgq10
|
8
|
+
Df8jXKzzbrRW/RQHbpAB1HItjTpXcy50FLiPGA1svMk4nUY0ssBtGX3yi0PDPGK3
|
9
|
+
Mn5YqbVx/Q+rgJ9kBIBtqrn2/BPRN8et7SgWoy1nebVJNipf+0lbTk7daqVT55cb
|
10
|
+
mNbNryT8oZFmC/1OICygSKT8aiwc7EsGptkXfRfO01Dfc5cTjgtEY/8VdF7ZUvU=
|
11
|
+
=4hv1
|
12
12
|
-----END PGP SIGNATURE-----
|
data/Rakefile
CHANGED
data/bin/crash-watch
CHANGED
@@ -42,14 +42,13 @@ elsif ARGV.size != 1
|
|
42
42
|
exit 1
|
43
43
|
end
|
44
44
|
|
45
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
45
46
|
require 'crash_watch/gdb_controller'
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
" Mac OS X: please install the Developer Tools or XCode\n"
|
47
|
+
begin
|
48
|
+
gdb = CrashWatch::GdbController.new
|
49
|
+
rescue GdbWatch::Error => e
|
50
|
+
abort e.message
|
51
51
|
end
|
52
|
-
gdb = CrashWatch::GdbController.new
|
53
52
|
begin
|
54
53
|
gdb.debug = options[:debug]
|
55
54
|
|
@@ -1,6 +1,17 @@
|
|
1
1
|
# encoding: binary
|
2
|
+
require 'rbconfig'
|
3
|
+
|
2
4
|
module CrashWatch
|
3
5
|
|
6
|
+
class Error < StandardError
|
7
|
+
end
|
8
|
+
|
9
|
+
class GdbNotFound < Error
|
10
|
+
end
|
11
|
+
|
12
|
+
class GdbBroken < Error
|
13
|
+
end
|
14
|
+
|
4
15
|
class GdbController
|
5
16
|
class ExitInfo
|
6
17
|
attr_reader :exit_code, :signal, :backtrace, :snapshot
|
@@ -20,19 +31,9 @@ class GdbController
|
|
20
31
|
END_OF_RESPONSE_MARKER = '--------END_OF_RESPONSE--------'
|
21
32
|
|
22
33
|
attr_accessor :debug
|
23
|
-
|
24
|
-
def self.gdb_installed?
|
25
|
-
ENV['PATH'].to_s.split(/:+/).each do |path|
|
26
|
-
filename = "#{path}/gdb"
|
27
|
-
if File.file?(filename) && File.executable?(filename)
|
28
|
-
return true
|
29
|
-
end
|
30
|
-
end
|
31
|
-
return false
|
32
|
-
end
|
33
|
-
|
34
|
+
|
34
35
|
def initialize
|
35
|
-
@pid, @in, @out = popen_command(
|
36
|
+
@pid, @in, @out = popen_command(find_gdb, "-n", "-q")
|
36
37
|
execute("set prompt ")
|
37
38
|
end
|
38
39
|
|
@@ -264,6 +265,57 @@ private
|
|
264
265
|
c.binmode
|
265
266
|
return [pid, b, c]
|
266
267
|
end
|
268
|
+
|
269
|
+
def find_gdb
|
270
|
+
result = nil
|
271
|
+
if ENV['GDB'] && File.executable?(ENV['GDB'])
|
272
|
+
result = ENV['GDB']
|
273
|
+
else
|
274
|
+
ENV['PATH'].to_s.split(/:+/).each do |path|
|
275
|
+
filename = "#{path}/gdb"
|
276
|
+
if File.file?(filename) && File.executable?(filename)
|
277
|
+
result = filename
|
278
|
+
break
|
279
|
+
end
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
puts "Found gdb at: #{result}" if result
|
284
|
+
|
285
|
+
config = defined?(RbConfig) ? RbConfig::CONFIG : Config::CONFIG
|
286
|
+
if config['target_os'] =~ /freebsd/ && result == "/usr/bin/gdb"
|
287
|
+
# /usr/bin/gdb on FreeBSD is broken:
|
288
|
+
# https://github.com/FooBarWidget/crash-watch/issues/1
|
289
|
+
# Look for a newer one that's installed from ports.
|
290
|
+
puts "#{result} is broken on FreeBSD. Looking for an alternative..."
|
291
|
+
result = nil
|
292
|
+
["/usr/local/bin/gdb76", "/usr/local/bin/gdb66"].each do |candidate|
|
293
|
+
if File.executable?(candidate)
|
294
|
+
result = candidate
|
295
|
+
break
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
if result.nil?
|
300
|
+
raise GdbBroken,
|
301
|
+
"*** ERROR ***: '/usr/bin/gdb' is broken on FreeBSD. " +
|
302
|
+
"Please install the one from the devel/gdb port instead. " +
|
303
|
+
"If you want to use another gdb"
|
304
|
+
else
|
305
|
+
puts "Found gdb at: #{result}" if result
|
306
|
+
return result
|
307
|
+
end
|
308
|
+
elsif result.nil?
|
309
|
+
raise GdbNotFound,
|
310
|
+
"*** ERROR ***: 'gdb' isn't installed. Please install it first.\n" +
|
311
|
+
" Debian/Ubuntu: sudo apt-get install gdb\n" +
|
312
|
+
"RedHat/CentOS/Fedora: sudo yum install gdb\n" +
|
313
|
+
" Mac OS X: please install the Developer Tools or XCode\n" +
|
314
|
+
" FreeBSD: use the devel/gdb port\n"
|
315
|
+
else
|
316
|
+
return result
|
317
|
+
end
|
318
|
+
end
|
267
319
|
end
|
268
320
|
|
269
321
|
end
|
data/lib/crash_watch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crash-watch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
metadata.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJRoN3dAAoJECrHRaUKISqMrRAH/0UTheexryuP9bNSJUEwzhra
|
6
|
+
AONBxRrOkHS+LCVIhCMQuoGUearG+m1gFUAP3DCtqUtWC+0MAy6/8U+ncxvr7bwk
|
7
|
+
/qqksKofHQPNCzuixjy7tY+uY4Dg/llXZd0PnzI2N/o8/N7epX8cud7Sw4/FUCS6
|
8
|
+
Eia8sIu6LjvxVeWiX9dOepkTZGikmBhiE0m/LsTpeKPxs5qMq3ZSuNub0vqDNjhD
|
9
|
+
n0SSOMTiFRWAnsmV3ldDLicoY9pB25eSYWshgbwBPky+rhsk4EO6EMFiwc1KsH6C
|
10
|
+
vtgb5OCAFmEMpgITae8YMFcKQTZ/Jn6AznYMlQiY5Uh7cQdjpmX9HQJzrwfhDgo=
|
11
|
+
=IW9j
|
12
12
|
-----END PGP SIGNATURE-----
|