readapt 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/readapt/monitor.c +46 -57
- data/lib/readapt/debugger.rb +6 -6
- data/lib/readapt/shell.rb +0 -12
- data/lib/readapt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540b9c4c18bdbd634b6db72f49fa456dc306f41f139f966770795f89850a130a
|
4
|
+
data.tar.gz: c0ebaf5c647ddb1c794904928902da3f8bed362562d631c25badf89acbebaef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6da35b56e5244c2f3e1071ca3899f790edbfd78291d2756f1a5b0c1ab22e746ac1e83e20ec8f899eaf6fe77a408d671f5a838c2b68fda3d4798ab10ac7b0e6a
|
7
|
+
data.tar.gz: 6a97d5f44f5b866e3b68a78a804b52ed90b2114204f9db180fe3fe7fbe49ccbb3d08567ccdd4783e565acdb0278b195fdd0676d9193c0e59b8cd73d3578a74f2
|
data/CHANGELOG.md
CHANGED
data/ext/readapt/monitor.c
CHANGED
@@ -86,52 +86,49 @@ process_line_event(VALUE tracepoint, void *data)
|
|
86
86
|
if (ref != Qnil)
|
87
87
|
{
|
88
88
|
ptr = thread_reference_pointer(ref);
|
89
|
-
|
89
|
+
threadPaused = (ptr->control == id_pause);
|
90
|
+
if (firstLineEvent && ptr->control == id_continue && breakpoints_files() == 0)
|
90
91
|
{
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
tmp = rb_tracearg_path(tp);
|
98
|
-
tp_file = normalize_path_new_cstr(StringValueCStr(tmp));
|
99
|
-
tp_line = NUM2LONG(rb_tracearg_lineno(tp));
|
100
|
-
|
101
|
-
dapEvent = id_continue;
|
102
|
-
if (!firstLineEvent)
|
103
|
-
{
|
104
|
-
if (strcmp(tp_file, entryFile) == 0)
|
105
|
-
{
|
106
|
-
firstLineEvent = 1;
|
107
|
-
ptr->control = rb_intern("entry");
|
108
|
-
process_line_event(tracepoint, data);
|
109
|
-
}
|
110
|
-
}
|
111
|
-
else if (threadPaused)
|
112
|
-
{
|
113
|
-
dapEvent = id_pause;
|
114
|
-
}
|
115
|
-
else if (match_step(ptr))
|
116
|
-
{
|
117
|
-
dapEvent = rb_intern("step");
|
118
|
-
}
|
119
|
-
else if (breakpoints_match(tp_file, tp_line))
|
120
|
-
{
|
121
|
-
dapEvent = rb_intern("breakpoint");
|
122
|
-
}
|
123
|
-
else if (ptr->control == id_entry)
|
124
|
-
{
|
125
|
-
dapEvent = id_entry;
|
126
|
-
}
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
tp = rb_tracearg_from_tracepoint(tracepoint);
|
95
|
+
tmp = rb_tracearg_path(tp);
|
96
|
+
tp_file = normalize_path_new_cstr(StringValueCStr(tmp));
|
97
|
+
tp_line = NUM2LONG(rb_tracearg_lineno(tp));
|
127
98
|
|
128
|
-
|
99
|
+
dapEvent = id_continue;
|
100
|
+
if (!firstLineEvent)
|
101
|
+
{
|
102
|
+
if (strcmp(tp_file, entryFile) == 0)
|
129
103
|
{
|
130
|
-
|
104
|
+
firstLineEvent = 1;
|
105
|
+
ptr->control = rb_intern("entry");
|
106
|
+
process_line_event(tracepoint, data);
|
131
107
|
}
|
108
|
+
}
|
109
|
+
else if (threadPaused)
|
110
|
+
{
|
111
|
+
dapEvent = id_pause;
|
112
|
+
}
|
113
|
+
else if (match_step(ptr))
|
114
|
+
{
|
115
|
+
dapEvent = rb_intern("step");
|
116
|
+
}
|
117
|
+
else if (breakpoints_match(tp_file, tp_line))
|
118
|
+
{
|
119
|
+
dapEvent = rb_intern("breakpoint");
|
120
|
+
}
|
121
|
+
else if (ptr->control == id_entry)
|
122
|
+
{
|
123
|
+
dapEvent = id_entry;
|
124
|
+
}
|
132
125
|
|
133
|
-
|
126
|
+
if (dapEvent != id_continue)
|
127
|
+
{
|
128
|
+
monitor_debug(tp_file, tp_line, tracepoint, ptr, dapEvent);
|
134
129
|
}
|
130
|
+
|
131
|
+
free(tp_file);
|
135
132
|
}
|
136
133
|
}
|
137
134
|
|
@@ -173,23 +170,15 @@ process_thread_begin_event(VALUE tracepoint, void *data)
|
|
173
170
|
here = rb_ary_pop(list);
|
174
171
|
if (here != Qnil)
|
175
172
|
{
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
"",
|
186
|
-
0,
|
187
|
-
tracepoint,
|
188
|
-
ptr,
|
189
|
-
rb_intern("thread_begin")
|
190
|
-
);
|
191
|
-
}
|
192
|
-
}
|
173
|
+
ref = thread_add_reference(here);
|
174
|
+
ptr = thread_reference_pointer(ref);
|
175
|
+
monitor_debug(
|
176
|
+
"",
|
177
|
+
0,
|
178
|
+
tracepoint,
|
179
|
+
ptr,
|
180
|
+
rb_intern("thread_begin")
|
181
|
+
);
|
193
182
|
}
|
194
183
|
}
|
195
184
|
|
data/lib/readapt/debugger.rb
CHANGED
@@ -105,16 +105,16 @@ module Readapt
|
|
105
105
|
# @param [Snapshot]
|
106
106
|
# return [void]
|
107
107
|
def debug snapshot
|
108
|
-
if
|
109
|
-
|
108
|
+
if snapshot.event == :thread_begin || snapshot.event == :entry
|
109
|
+
@threads[snapshot.thread_id] ||= Thread.new(snapshot.thread_id)
|
110
|
+
thr = @threads[snapshot.thread_id]
|
110
111
|
thr.control = :continue
|
111
|
-
@threads[snapshot.thread_id] = thr
|
112
112
|
send_event('thread', {
|
113
113
|
reason: 'started',
|
114
114
|
threadId: snapshot.thread_id
|
115
115
|
}, true)
|
116
116
|
snapshot.control = :continue
|
117
|
-
elsif
|
117
|
+
elsif snapshot.event == :thread_end
|
118
118
|
thr = thread(snapshot.thread_id)
|
119
119
|
thr.control = :continue
|
120
120
|
@threads.delete snapshot.thread_id
|
@@ -123,8 +123,8 @@ module Readapt
|
|
123
123
|
threadId: snapshot.thread_id
|
124
124
|
})
|
125
125
|
snapshot.control = :continue
|
126
|
-
elsif snapshot.event == :entry
|
127
|
-
|
126
|
+
# elsif snapshot.event == :entry
|
127
|
+
# snapshot.control = :continue
|
128
128
|
else
|
129
129
|
changed
|
130
130
|
thread = self.thread(snapshot.thread_id)
|
data/lib/readapt/shell.rb
CHANGED
@@ -28,18 +28,6 @@ module Readapt
|
|
28
28
|
Readapt::Adapter.host debugger
|
29
29
|
machine.prepare Backport::Server::Tcpip.new(host: options[:host], port: options[:port], adapter: Readapt::Adapter)
|
30
30
|
STDERR.puts "Readapt Debugger #{Readapt::VERSION} is listening HOST=#{options[:host]} PORT=#{options[:port]} PID=#{Process.pid}"
|
31
|
-
# Redirect STDOUT and STDERR through the adapter protocol
|
32
|
-
# @todo This feature does not always work with STDERR, e.g, when
|
33
|
-
# running RSpec
|
34
|
-
cats = ['stdout', 'stderr']
|
35
|
-
[STDOUT, STDERR].each do |io|
|
36
|
-
cat = cats.shift
|
37
|
-
io.instance_eval do
|
38
|
-
define_singleton_method :write do |*args, &block|
|
39
|
-
debugger.output args.join, cat
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
31
|
end
|
44
32
|
end
|
45
33
|
end
|
data/lib/readapt/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.2
|
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-09-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|