Closed yewton closed 1 month ago
Stale issue message
This is still the case.
Hi @yewton - do you mind opening a PR so the contribution is properly assigned to you once merged?
Hi @jbachorik
Thank you for your suggestion. I'm still wrapping my head around the instrumentor module to ensure I've covered all the necessary areas before creating a pull request. I'd appreciate it if you could point me in the right direction.
No problem, what exactly are you looking for?
I'm having trouble figuring out how to test the changes I made to Instrumentor
.
Could you provide some guidance on what specific test cases I should write to verify that this bug has been fixed?
Are there any existing test cases that I could use as a reference?
Here is the test for static field get - https://github.com/btraceio/btrace/blob/4d6da4221a46537c5634d1e667449036b64ae4c2/btrace-instr/src/test/java/org/openjdk/btrace/instr/InstrumentorTest.java#L1867
There is similar test case for non-static get etc.
You would need to modify https://github.com/btraceio/btrace/blob/4d6da4221a46537c5634d1e667449036b64ae4c2/btrace-instr/src/test/btrace/onmethod/FieldGetBeforeStatic.java#L44 such that the field
in the @Location
definition is by regex as when it is an exact field name match there would be no difference with your patch (both, the target field name and the real field name are the same).
For integration tests, you would adjust/extend https://github.com/btraceio/btrace/blob/develop/integration-tests/src/test/java/tests/BTraceFunctionalTests.java
Thank you for your help. I'll give it a try.
Possible fix: https://github.com/yewton/btrace/pull/1/files