-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAP: introduce Rdbg Trace Inspector #916
Conversation
I've been wanting this feature for a while, this looks super cool 🎉 |
We can select the option as follows: Screen.Recording.2023-02-27.at.18.03.30.mov |
Yeah, I think that we can add tests. |
lib/debug/tracer.rb
Outdated
@@ -148,6 +148,78 @@ def skip_with_pattern?(tp) | |||
end | |||
end | |||
|
|||
class MultiTracer < Tracer | |||
MAX_LENGTH = 4000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LENGTH
-> RECORDS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or LOGS
if you u se @log
@@ -148,6 +148,78 @@ def skip_with_pattern?(tp) | |||
end | |||
end | |||
|
|||
class MultiTracer < Tracer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Now it is only for DAP
lib/debug/tracer.rb
Outdated
@tracer = TracePoint.new(*@evts){|tp| | ||
next if skip?(tp) | ||
|
||
call_identifier_str = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cut off to the method
lib/debug/server_dap.rb
Outdated
when 'return' | ||
evts << :return | ||
evts << :c_return | ||
evts << :b_return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
raise "unknown trace type #{evt}"
lib/debug/server_dap.rb
Outdated
when 'enable' | ||
events = req.dig('arguments', 'events') | ||
evts = [] | ||
events.each{|evt| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea:
EVENTS = {'line' => [:line], ...}
def ...
evts = []
events.each{|evt| evts.concat EVENTS[evt]}
...
or
evts = events.flat_map{|evt| EVENTS[evt]}
But the current code makes sense because it is easy to read.
lib/debug/server_dap.rb
Outdated
end | ||
} | ||
@ui.respond req, {} | ||
when 'logs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other subcommands are verbs so I recommend to use collect
(a verb word)
d198e27
to
6d9078d
Compare
@ono-max Thanks. Could we first have some tests in the same PR? |
I'll try it, but I'm not sure if I can add tests in the same PR because I'm busy right now. There is a possibility they are added in the other PR. Sorry. |
6d9078d
to
b9e1758
Compare
af8d49f
to
35bab9d
Compare
35bab9d
to
336e1dc
Compare
We'll introduce a new feature Rdbg Trace Inspector. This is useful when tracing in VS Code.
Untitled.Project.4.-.HD.1080p.mov
How to use it
That's it! You can check the location and returned value by clicking the trace log.
How to choose events
On the default, line, call, and return events are selected.
If you want to change the default, click "more items", then choose events in the context menu.
Screen.Recording.2023-02-27.at.18.03.30.mov