sourceplusplus icon indicating copy to clipboard operation
sourceplusplus copied to clipboard

Source code changes result in incorrect line numbers

Open MrMineO5 opened this issue 3 years ago • 2 comments

When the source code has been edited in the IDE, the line numbers no longer match those of the probe.

This may be quite difficult, but it could be possible to try to find the corresponding instruction by comparing a few of the surrounding bytecode instructions and trying to find the best match in the code that the probe has.

MrMineO5 avatar Sep 30 '22 08:09 MrMineO5

This will be one of the defining features of the v0.8.0 release (see also: #461). Essentially, Source++ will offer the means to set the commit id of the project the probe is currently attached to. This would be through a file you include in your deployment, an API you call during boot, or an event you trigger during deployment.

The deployed commit would be compared to your local commit. If different, there would be a notification such as: image


Regardless of the warning, Source++ will make the best effort to try to calculate the line number based on active changes and line changes between current and deployed commit. I'm sure the first version will be pretty simple. It'll be looking for exact matches near the expected line number.

When commit ids can't be found it'll assume the deployed code is on the same commit and only consider active changes. Or perhaps turn line detection off entirely (or as a default setting).

BFergerson avatar Oct 06 '22 18:10 BFergerson

Added ability to associate SkyWalking services to VCS commits via #461 in v0.7.9. This issue will be addressed next.

BFergerson avatar Jul 04 '23 16:07 BFergerson