Class: Readapt::Message::StackTrace

Inherits:
Base
  • Object
show all
Defined in:
lib/readapt/message/stack_trace.rb

Constant Summary collapse

@@file_hash =
{}

Instance Attribute Summary

Attributes inherited from Base

#arguments, #debugger

Instance Method Summary collapse

Methods inherited from Base

#body, #initialize, run, #set_body

Constructor Details

This class inherits a constructor from Readapt::Message::Base

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/readapt/message/stack_trace.rb', line 8

def run
  frames = debugger.thread(arguments['threadId']).frames
  set_body({
    stackFrames: frames.map do |frm|
      {
        name: frame_code(frm.file, frm.line),
        source: {
          name: frm.file ? File.basename(frm.file) : nil,
          path: frm.file
        },
        id: frm.local_id,
        line: frm.line,
        column: 0
      }
    end,
    totalFrames: frames.length
  })
end