feat(tracer): Record function calls and returns #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit also records function calls and returns from functions, without passing the actual arguments and values in either direction. That would be a follow-up.
Details:
get_variables
is now public intooling/debugger/src/context.rs
; it is needed to extract the stack frame from the debugger;trace_metadata.json
is also stored, because the frontend expects that too;tail_diff_vecs
is a generic utility function to extract the difference between two vectors; it has good documentation, so details within;StackFrame
is introduced, because theStackFrame
in the debugger does not own its data; here, we need to remember the previous stack trace (a vector ofStackFrame
's) in order to discover function calls or returns, so we need to own the data;stack_trace
field is added toTracingContext
; see previous point;fn get_stack_trace
performs the conversion mentioned;update_record
are the basis fortail_diff_vecs
; the new contents use that function to perform the same operation as before; in addition, the core logic of the PR is here: return events are registered for dropped stack frames and call events are registered for new stack frames;To test: