Skip to content
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 #959

Merged
merged 1 commit into from
Apr 29, 2023
Merged

Conversation

ono-max
Copy link
Member

@ono-max ono-max commented Apr 8, 2023

Summary

We introduce Rdbg Trace Inspector. This is useful when tracing in VS Code. Users can search tracing logs easily and get a lot of useful information by using Rdbg Trace Inspector. For example, users can know which method is called, which line is executed, local variables at some point, and so on.

How to use it

  1. Click on "Start Trace" in TRACE INSPECTOR view
  2. Execute the program

That's it! You can check the location and returned value by clicking the trace log.

Several demos

Trace Call/Return

Users can know which method is called, its parameters, and return values.

Screen.Recording.2023-04-16.at.14.50.48.mov

Record & Replay

This is slow, but Users can get a wealth of information by enabling Record & Replay. For example, users can know the backtrace and local variables during the execution.

Screen.Recording.2023-04-16.at.14.28.48.mov

Other

Trace Call and Trace Line are enabled in the default. Users can select Record & Replay from the menu.
Also, users can enter Regular Expressions to trace only matched events as follows.

Screen.Recording.2023-04-17.at.15.36.52.mov

Users can copy the specific log as follows:

Screen.Recording.2023-04-22.at.16.23.42.mov

Some Notes: This PR is the combination of #946 and #916. After discussing with @ko1-san, we decided to combine record inspector and trace inspector.

@ono-max ono-max changed the title DAP: introduce Rdbg Record Inspector DAP: introduce Rdbg Inspector Apr 8, 2023
@ono-max ono-max marked this pull request as draft April 9, 2023 14:54
@ono-max ono-max force-pushed the rdbg-inspector branch 2 times, most recently from 02b0216 to 4dc44d3 Compare April 17, 2023 11:17
@ono-max ono-max changed the title DAP: introduce Rdbg Inspector DAP: introduce Rdbg Trace Inspector Apr 17, 2023
@ono-max ono-max marked this pull request as ready for review April 17, 2023 15:00
@@ -147,6 +147,17 @@ def local_variables
end
end

def get_params
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def iseq_parameters_info
...
when :block, :method
  parameters_info
else
  nil
end

module DAP_TraceInspector
class MultiTracer < Tracer
MAX_LOG_SIZE = 4000
def initialize ui, evts, trace_params, **kw
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_log_size: 4000

@ono-max ono-max force-pushed the rdbg-inspector branch 8 times, most recently from 35eef6a to c38c836 Compare April 29, 2023 04:53
@ko1 ko1 merged commit caeb4c9 into ruby:master Apr 29, 2023
@ono-max ono-max deleted the rdbg-inspector branch April 29, 2023 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants