MartinBalin commented on code in PR #9732:
URL: https://github.com/apache/netbeans/pull/9732#discussion_r4317746038
##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/BreakpointOutput.java:
##########
@@ -375,13 +376,45 @@ private void printOutEvent(DebuggerConsoleIO io, String
format, JPDABreakpointEv
printText = selectCondition(printText, threadStartedCondition,
false);
}
}
+
+ int printLocals = printText.indexOf(localsPattern);
+ if (printLocals != -1) {
+ printText = printText.substring(0, printLocals) +
printText.substring(printLocals + localsPattern.length());
+ }
// 5) resolve all expressions {=expression}
printExpressions(event, printText, (msg, action) -> {
io.printWithAction(msg, action, false);
}, (msg) -> {
io.println(msg, null);
});
+
+ if (printLocals != -1) {
+ CallStackFrame csf = findTopFrame(event);
+ if (csf != null) {
+ try {
+ for (var refValue : csf.getLocalVariables()) {
+ io.printWithAction(" ", null, false);
+ io.printWithAction(refValue.getName(), null, false);
+ io.printWithAction(" = ", null, false);
+ if (refValue instanceof ObjectVariable obj &&
!isNull(obj)) {
+ var sessionRef = new WeakReference<>(session);
+ io.printWithAction(obj.getValue(), () -> {
Review Comment:
Sorry for editing your comment, newly using GH PR extension in VS Code and
it has some editing specialities....
[LogpointReviewTests.zip](https://github.com/user-attachments/files/33680625/LogpointReviewTests.zip)
this is quick and dirty review regression test.
cp `LogpointReviewTest.java` to
`java/debugger.jpda.ui/test/unit/src/org/netbeans/modules/debugger/jpda/ui/`
cp `LogpointReviewMain.java` to `java/debugger.jpda.ui/test/unit/src/test/`
Set: `review_jvm_flags="$(cat
nbbuild/jms-config/{base,desktop,compiler}.flags | tr '\n' ' ')"`
Run then:
```
ANT_OPTS=-Djava.awt.headless=true \
ant -f java/debugger.jpda.ui/build.xml test-unit \
-Dtest.includes='**/LogpointReviewTest.class' \
-Dtest.qa-functional.src.dir=/tmp/pr9732-no-tests \
"-Dtest.run.args=-ea -Djava.awt.headless=true
-XX:+IgnoreUnrecognizedVMOptions $review_jvm_flags"
```
Should fail with something like: `Earlier hyperlink should still target the
first object
expected:<89> but was:<97>`
ID/numbers can differ for your run. Hope this helps
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists