Closed
Conversation
Use a new and improved method to preserve line information from the original source file into the modified AST; by comparing information about original nodes in the decorator's view with those in the restorer's. This ensures better correspondance, emits fewer line directives, and shoudl result in better debugging experience on instrumented code.
Create a new `injector.Injector` API that does not rely on `decorator.Load` (internally using `packages.Load`), instead using the basic `go/types` API to type-check the AST nodes in order to obtain the `Uses` map that is sufficient to build an import-managing `decorator.Decorator` instance. The package name resolution is done by parsing type information from the archives mentioned in the `importcfg` file. This change removes unnecessary compilation of un-instrumented archives which are not useful, and hence saves time and disk space.
…injector-api # Conflicts: # internal/injector/injector.go
…r/new-injector-api
…injector-api # Conflicts: # internal/injector/injector.go # internal/injector/lineinfo/annotation.go # internal/injector/lineinfo/lineinfo.go # internal/toolexec/aspect/oncompile.go
Co-authored-by: Eliott Bouhana <47679741+eliottness@users.noreply.github.com>
…injector-api # Conflicts: # internal/injector/builtin/integration_test.go # internal/injector/testdata/injector/access-return-value/expected.diff
The `method-call` join point can be used to match calls to a specific method, given the receiver type and method name. The receiver is matched exactly, meaning that no interface resolution is done... Interface calls are matched only if the configured receiver type is the interface itself.
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.
The
method-calljoin point can be used to match calls to a specific method, given the receiver type and method name. The receiver is matched exactly, meaning that no interface resolution is done... Interface calls are matched only if the configured receiver type is the interface itself.