Support new style diagnostic reports
This commit is contained in:
parent
4378de02f9
commit
3cbe37bd35
@ -297,16 +297,24 @@ module EnvUtil
|
||||
cmd = @ruby_install_name if "ruby-runner#{RbConfig::CONFIG["EXEEXT"]}" == cmd
|
||||
path = DIAGNOSTIC_REPORTS_PATH
|
||||
timeformat = DIAGNOSTIC_REPORTS_TIMEFORMAT
|
||||
pat = "#{path}/#{cmd}_#{now.strftime(timeformat)}[-_]*.crash"
|
||||
pat = "#{path}/#{cmd}_#{now.strftime(timeformat)}[-_]*.{crash,ips}"
|
||||
first = true
|
||||
30.times do
|
||||
first ? (first = false) : sleep(0.1)
|
||||
Dir.glob(pat) do |name|
|
||||
log = File.read(name) rescue next
|
||||
if /\AProcess:\s+#{cmd} \[#{pid}\]$/ =~ log
|
||||
File.unlink(name)
|
||||
File.unlink("#{path}/.#{File.basename(name)}.plist") rescue nil
|
||||
return log
|
||||
case name
|
||||
when /\.crash\z/
|
||||
if /\AProcess:\s+#{cmd} \[#{pid}\]$/ =~ log
|
||||
File.unlink(name)
|
||||
File.unlink("#{path}/.#{File.basename(name)}.plist") rescue nil
|
||||
return log
|
||||
end
|
||||
when /\.ips\z/
|
||||
if /^ *"pid" *: *#{pid},/ =~ log
|
||||
File.unlink(name)
|
||||
return log
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user