[15] RFR(XS): 8244182: Use root node as default for find_node when called from debugger

Christian Hagedorn christian.hagedorn at oracle.com
Thu Apr 30 09:09:41 UTC 2020


Hi

Please review the following small enhancement for debugging:
https://bugs.openjdk.java.net/browse/JDK-8244182
http://cr.openjdk.java.net/~chagedorn/8244182/webrev.00/

I often find myself calling find_node(Node* n, int idx) from gdb using 
the following command:

(gdb) p find_node(C->_root, 42)
$1 = (Node *) 0x7ffff08cab68

When C is not defined I need to search for a different node to use in 
the same method which is an additional effort. Moreover, there is 
sometimes no node and then I either need to go up in the current stack 
until C is defined or use Compile::current()->_root. But that does not 
work with gdb and neither does Compile::current()->root():

(gdb) p find_node(Compile::current()->_root, 42)
A syntax error in expression, near `()->_root, 42)'.
(gdb) p find_node(Compile::current()->root(), 42)
A syntax error in expression, near `()->root(), 42)'.

As a workaround I do the following which is quite tedious:

(gdb) p Compile::current()->_root
$2 = (RootNode *) 0x7fffa8072ae0
(gdb) p find_node((RootNode *) 0x7fffa8072ae0, 42)
$3 = (Node *) 0x7ffff08cab68

Therefore, I suggest to add a default to use the root node which is 
probably the most likely use case.

Thank you!

Best regards,
Christian


More information about the hotspot-compiler-dev mailing list