readapt 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad64fe3f51193626e5680b735f161da45661c7aba6cede8c1b46fa92e3d19cad
4
- data.tar.gz: 52a5fc764ca16387d5e0c9a18bbf17f183bdf81de5ce87bfed3104060df68f3c
3
+ metadata.gz: 5b7636af36f8a909b5236cc8ad86e6af713001782bea468bf5a21fe8e085ce9f
4
+ data.tar.gz: 72df0ffe3730ee6aa89139276587ba23c7543ca27ab6b9e6ab30376689ce0af4
5
5
  SHA512:
6
- metadata.gz: 7f3ec831e7e0c0a998083407b09e14a7c2217394ab0b606e00b5d13862ba1f8b5fb1e84fd903541661717ba4b177c558d8150ec2bb026393847bbd491877eace
7
- data.tar.gz: d554b97e4f41d461ce33d0f9ebcf1b282e8b06da5a0a9a2dfdbdecb85ac585f4a0373a6068c5b9d6786449645181900ca848a6ecc4db1c49cee772a4cce736cb
6
+ metadata.gz: 8feae8ecff76cf7e1793af4be1e234b1b57de1b32dc159ada70255bae1656229592f4257e9376ec3cecf05c158f06f8820befe0e5fd8db4f8b14141825e914a6
7
+ data.tar.gz: 9512c303ca521814091f16694b6004f274935d760215c442617bff8876d97c6d9716bbf9d0276100f018d3804dbfa81c0ee7a54aa83eb7625e70b9d362b8becd
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
- # 0.5.0 = August 20, 2019
1
+ # 0.6.0 - August 26, 2019
2
+ - Evaluate in REPL
3
+
4
+ # 0.5.0 - August 20, 2019
2
5
  - Monitor stores paths as C strings
3
6
  - Fixed malloc size for normalized paths
4
7
  - Fixed table insertion before existing items
data/lib/readapt/frame.rb CHANGED
@@ -9,6 +9,12 @@ module Readapt
9
9
  @binding = ObjectSpace._id2ref(binding_id)
10
10
  end
11
11
 
12
+ def evaluate code
13
+ @binding.eval(code).inspect
14
+ rescue Exception => e
15
+ "[#{e.class}] #{e.message}"
16
+ end
17
+
12
18
  def local_id
13
19
  @binding.object_id
14
20
  end
@@ -26,43 +32,11 @@ module Readapt
26
32
  result
27
33
  end
28
34
 
29
- def variables
30
- return [] if @binding.nil?
31
- result = []
32
- @binding.local_variables.each do |sym|
33
- var = @binding.local_variable_get(sym)
34
- result.push Variable.new(sym, var)
35
- end
36
- if @binding.receiver != TOPLEVEL_BINDING.receiver
37
- @binding.instance_variables.each do |sym|
38
- var = @binding.receiver.instance_variable_get(sym)
39
- result.push Variable.new(sym, var)
40
- end
41
- @binding.class.class_variables.each do |sym|
42
- var = @binding.receiver.class.class_variable_get(sym)
43
- result.push Variable.new(sym, var)
44
- end
45
- end
46
- result
47
- end
48
-
49
35
  def local sym
50
36
  return @binding.receiver if sym == :self
51
37
  @binding.local_variable_get sym
52
38
  end
53
39
 
54
- def globals
55
- global_variables
56
- end
57
-
58
- def global sym
59
- global sym
60
- end
61
-
62
- def evaluate code
63
- @binding.eval code
64
- end
65
-
66
40
  NULL_FRAME = Frame.new(nil, nil.object_id)
67
41
  end
68
42
  end
@@ -17,6 +17,7 @@ require 'readapt/message/step_out'
17
17
  require 'readapt/message/disconnect'
18
18
  require 'readapt/message/attach'
19
19
  require 'readapt/message/pause'
20
+ require 'readapt/message/evaluate'
20
21
 
21
22
  module Readapt
22
23
  module Message
@@ -53,5 +54,6 @@ module Readapt
53
54
  register 'stepOut', Message::StepOut
54
55
  register 'disconnect', Message::Disconnect
55
56
  register 'pause', Message::Pause
57
+ register 'evaluate', Message::Evaluate
56
58
  end
57
59
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+
5
+ module Readapt
6
+ module Message
7
+ class Evaluate < Base
8
+ def run
9
+ ref = arguments['frameId']
10
+ frame = debugger.frame(ref)
11
+ result = frame.evaluate(arguments['expression'])
12
+ set_body(
13
+ result: result
14
+ )
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Readapt
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readapt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2019-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport
@@ -140,6 +140,7 @@ files:
140
140
  - lib/readapt/message/configuration_done.rb
141
141
  - lib/readapt/message/continue.rb
142
142
  - lib/readapt/message/disconnect.rb
143
+ - lib/readapt/message/evaluate.rb
143
144
  - lib/readapt/message/initialize.rb
144
145
  - lib/readapt/message/launch.rb
145
146
  - lib/readapt/message/next.rb