Class: Satyr::Stacktrace
- Inherits:
-
Object
- Object
- Satyr::Stacktrace
- Defined in:
- lib/satyr.rb
Overview
Program stack trace, possibly composed of multiple threads
Instance Method Summary collapse
-
#find_crash_thread ⇒ Object
Returns Thread that likely caused the crash that produced this stack trace.
-
#initialize(pointer) ⇒ Stacktrace
constructor
Private constructor - Stacktrace objects are created in Report#stacktrace.
Constructor Details
#initialize(pointer) ⇒ Stacktrace
Private constructor - Stacktrace objects are created in Report#stacktrace
139 140 141 142 |
# File 'lib/satyr.rb', line 139 def initialize(pointer) raise SatyrError, "Invalid structure" if pointer.null? @struct = Satyr::FFI::StacktraceStruct.new pointer end |
Instance Method Details
#find_crash_thread ⇒ Object
Returns Thread that likely caused the crash that produced this stack trace
147 148 149 150 151 152 153 154 |
# File 'lib/satyr.rb', line 147 def find_crash_thread pointer = Satyr::FFI.sr_stacktrace_find_crash_thread @struct.to_ptr raise SatyrError, "Could not find crash thread" if pointer.null? dup = Satyr::FFI.sr_thread_dup(pointer) raise SatyrError, "Failed to duplicate thread" if dup.null? Thread.send(:new, dup) end |