RFR: 8344165: Trace exceptions with a complete call-stack [v4]

David Holmes dholmes at openjdk.org
Tue Jun 10 12:45:29 UTC 2025


On Mon, 9 Jun 2025 23:24:23 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/logging/ExceptionsTest.java line 48:
>> 
>>> 46:     static void analyzeOutputOn(ProcessBuilder pb) throws Exception {
>>> 47:         OutputAnalyzer output = new OutputAnalyzer(pb.start());
>>> 48:         System.out.println(output.getStdout());
>> 
>> Debugging code?
>> 
>> If you really want to always print the output then the more common pattern is to use `out.reportDiagnosticSummary()` after all the checks have been done and so the test has passed (failing tests will print it anyway).
>
> The output is printed only if the failure happens in `OutputAnalyzer::shouldMatch()`, etc. I've updated the test so failures can happen other ways, so I cannot rely on this anymore.

Sorry I don't follow. I'm saying there is no need to print stdout here because upon failure it will be printed anyway. If you want to see stdout even in passing cases then do this after all the `shouldXXX` checks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25522#discussion_r2137788195


More information about the hotspot-dev mailing list