RFR: 8344165: Trace exceptions with a complete call-stack [v7]
Ioi Lam
iklam at openjdk.org
Tue Jun 10 00:05:54 UTC 2025
> This PR makes it easier to analyze exceptions without modifying the JVM or the app to print call stacks:
>
> Excerpt from the test case ExceptionsTest.java.
>
>
> [0.038s][info][exceptions ] Exception <a 'java/lang/RuntimeException'{0x0000000474019bd8}: Test exception 2 for logging>
> [ ] thrown in interpreter method <{method} {0x000074c408400810} 'baz2' '()V' in 'ExceptionsTest$InternalClass'>
> [ ] at bci 9 for thread 0x000074c46402c7b0 (main)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.baz2(ExceptionsTest.java:142)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.bar2(ExceptionsTest.java:135)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.foo2(ExceptionsTest.java:127)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.main(ExceptionsTest.java:110)
> [0.038s][info][exceptions ] Exception <a 'java/lang/RuntimeException'{0x0000000474019bd8}: Test exception 2 for logging>
> [ ] thrown in interpreter method <{method} {0x000074c408400748} 'bar2' '()V' in 'ExceptionsTest$InternalClass'>
> [ ] at bci 0 for thread 0x000074c46402c7b0 (main)
> [0.038s][info][exceptions ] Found matching handler for exception of type "java.lang.RuntimeException" in method "bar2" at BCI: 6
> [0.038s][info][exceptions ] Exception <a 'java/lang/RuntimeException'{0x0000000474019bd8}: Test exception 2 for logging>
> [ ] thrown in interpreter method <{method} {0x000074c408400748} 'bar2' '()V' in 'ExceptionsTest$InternalClass'>
> [ ] at bci 8 for thread 0x000074c46402c7b0 (main)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.bar2(ExceptionsTest.java:137)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.foo2(ExceptionsTest.java:127)
> [0.038s][info][exceptions,stacktrace] at ExceptionsTest$InternalClass.main(ExceptionsTest.java:110)
> [0.038s][info][exceptions ] Exception <a 'java/lang/RuntimeException'{0x0000000474019bd8}: Test exception 2 for logging>
> [ ] thrown in interpreter method <{method} {0x000074c408400670} 'foo2' '()V' in 'ExceptionsTest$InternalClass'>
> [ ] at bci 0 for thread 0x000074c46402c7b0 (main)
> [0.038s][info][exceptions ] Found m...
Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
Print callstack for rethrown exceptions
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25522/files
- new: https://git.openjdk.org/jdk/pull/25522/files/547171ae..cc451e7e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25522&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25522&range=05-06
Stats: 40 lines in 4 files changed: 25 ins; 0 del; 15 mod
Patch: https://git.openjdk.org/jdk/pull/25522.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25522/head:pull/25522
PR: https://git.openjdk.org/jdk/pull/25522
More information about the hotspot-dev
mailing list