jtulach commented on code in PR #9732:
URL: https://github.com/apache/netbeans/pull/9732#discussion_r4317059169


##########
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:
   > ..temporary native test reporduced this ...
   
   I don't understand. What is the test doing? True tests were missing, but 
I've just added one in 15eb8c4192. It passes. What's the problem with the 
`ObjectLocalVariable`? Following code seems to be logging value of `fac` array 
properly:
   
   <img width="790" height="1049" alt="fac array" 
src="https://github.com/user-attachments/assets/3bf6217c-6bec-41de-9400-cc495159ccd9";
 />
   



-- 
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

Reply via email to