RFR: 8263790: C2: new igv_print_immediately() for debugging purpose

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Mon Apr 12 10:26:49 UTC 2021


On Thu, 18 Mar 2021 10:05:12 GMT, Yi Yang <yyang at openjdk.org> wrote:

> Add a new igv_print_immediately, it prints the current method immediately. This differs from other igv_print* methods, it creates a well-formed and complete ideal graph xml immediately, while others accomplish their ideal graph xml when VM exists (i.e. destructor of `IdealGraphPrinter::_xx_printer`). If VM crashes before VM exit, the ideal graph xml will be ill-formed, this is fairly a common case when debugging another crash.
> 
> Test manually!
> 
> Cheers,
> Yang

> In the catch clause, ex.getMessage() compares with ASCII characters, but ex.getMessage()gets characters that corresponding to their system locale settings. To support non-English system locale settings(if needed), we could code something like this:
> 
> ```java
>      if (!(ex instanceof SAXParseException) || !"XML document structures must start and end within the same entity.".equals(disable_i18n(ex.getMessage())))
> ```

That makes sense, can you please try if this fix works for you? https://github.com/robcasloz/jdk/commit/702e763

If it does, please feel free to re-purpose this issue with the proposed fix (once https://github.com/openjdk/jdk/pull/3361 is integrated), and with a test case that parses an incomplete XML document in `src/utils/IdealGraphVisualizer/Data/src/test/java/com/sun/hotspot/igv/data/serialization/ParserTest.java`. Please make sure to test in on different JDK versions (I suggest JDK 8, 11, and 15).

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

PR: https://git.openjdk.java.net/jdk/pull/3071


More information about the hotspot-compiler-dev mailing list