Class: DEBUGGER__::DAP_TraceInspector::Custom_Recorder

Inherits:
ThreadClient::Recorder show all
Defined in:
lib/debug/dap_custom/traceInspector.rb

Instance Attribute Summary collapse

Attributes inherited from ThreadClient::Recorder

#backup_frames, #index, #log

Instance Method Summary collapse

Methods inherited from ThreadClient::Recorder

#can_step_back?, #current_frame, #current_position, #disable, #enable, #enabled?, #log_index, #replaying?, #step_back, #step_forward, #step_reset

Methods included from SkipPathHelper

#skip_config_skip_path?, #skip_internal_path?, #skip_location?, #skip_path?

Constructor Details

#initialize(max_log_size: nil) ⇒ Custom_Recorder

Returns a new instance of Custom_Recorder.



104
105
106
107
108
109
110
111
112
# File 'lib/debug/dap_custom/traceInspector.rb', line 104

def initialize max_log_size: nil
  if max_log_size
    @max_log_size = max_log_size
  else
    @max_log_size = 50000
  end
  @dropped_trace_cnt = 0
  super()
end

Instance Attribute Details

#dropped_trace_cntObject

Returns the value of attribute dropped_trace_cnt.



114
115
116
# File 'lib/debug/dap_custom/traceInspector.rb', line 114

def dropped_trace_cnt
  @dropped_trace_cnt
end

Instance Method Details

#append(frames) ⇒ Object



116
117
118
119
120
121
122
# File 'lib/debug/dap_custom/traceInspector.rb', line 116

def append frames
  if @log.size >= @max_log_size
    @dropped_trace_cnt += 1
    @log.shift
  end
  @log << frames
end