Repository navigation
Conversation
Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
This was referenced Nov 25, 2026
Track must-statement execution tracing across yang-parser, data-server and sdc-lite
sdcio/.github#51
Open
steiler
added a commit
to sdcio/sdc-lite
that referenced
this pull request
Nov 26, 2026
Pseudo-versions track sdcio/data-server#566 and sdcio/yang-parser#41 until those changes are released; released tags lack MustTracer and xpath.Tracer. Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an opt-in execution tracer to the XPath VM so callers can observe each instruction, the evaluation stack, path stack and predicate keys, interleaved with host-side adapter calls.
xpath/tracer.go:Tracerinterface,TraceEvent/TraceEventKind(vm_start,vm_instr,vm_instr_done,vm_end),FormatDatum, and stack/path/predicate snapshot helpers.xpath/context.go:SetTracer(Tracer); the tracer propagates into predicate and function sub-contexts. Recovered VM panics are reported withPanicked: true.xpath/datum.go,xpath/xutils/xpath_node.go: safe string rendering of all datum kinds, and<nil>guards for placeholder nodesets. Without these guards, debug printing panics on the[nil, ...]nodesets thatdata-serverbuilds for listcount().No behaviour changes when no tracer is set.
Cross-references
Merge order
github.com/sdcio/yang-parserto that tag)Testing
go test -race ./xpath -run TestTracergo test ./xpath/xutilsgo vet ./xpath/...Note: on
origin/main, the legacyXpathNodetests (TestCodePredEndInMainProgram,xpath/grammars/expr,xpath/grammars/path_eval) and thexpath/grammars/leafrefbuild already fail. They are not touched by this PR.