-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8266967: debug.cpp utility find() should print Java Object fields. #4011
Conversation
👋 Welcome back kevinw! A progress list of the required criteria for merging this PR into |
@kevinjwalls The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Oops the #ifndef PRODUCT move in instanceKlass.hpp made more than just the oop printers visible, moving it to line 1270, above print_dependent_nmethods. |
/label serviceability |
@kevinjwalls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kevin,
The fix looks okay to me.
Thanks,
Serguei
@kevinjwalls This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good!
Thanks Serguei and Coleen! |
/integrate |
@kevinjwalls Since your change was applied there has been 1 commit pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 5e557d8. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This change enables debug.cpp's find() utility to print Java Objects with their fields.
find() calls os::print_location, and Java heap objects are printed with instanceKlass oop_print_on.
Removing the ifdef for defining oop_print_on for instanceKlass, and also on methods in FieldPrinter and FieldDescriptor, make this work.
Checking other uses of os::print_location this might affect:
macroAssembler_x86.cpp has MacroAssembler::print_state32 and MacroAssembler::print_state64
which use os::print_location to print register contents and print words at top of stack.
These will be more verbose, as it already is in non-PRODUCT builds.
vmError uses os::print_location when showing the stack, i.e. this output:
Stack slot to memory mapping:
stack at sp + 0 slots: 0x0000000000000002 is an unknown value
..etc...
...will be more verbose when Java object references are found (for the 8 stack slots it tries to show).
Shenandoah uses os::print_location once, but for non-Java heap objects so nothing changes.
Manual testing on Linux-x64 and Windows: old behaviour shows these two lines only:
"Executing find"
0x00000000ff0a03e0 is an oop: jdk.internal.loader.ClassLoaders$AppClassLoader
{0x00000000ff0a03e0} - klass: 'jdk/internal/loader/ClassLoaders$AppClassLoader'
...then with the change the full info:
"Executing find"
0x00000000ff0a03e0 is an oop: jdk.internal.loader.ClassLoaders$AppClassLoader
{0x00000000ff0a03e0} - klass: 'jdk/internal/loader/ClassLoaders$AppClassLoader'
40} (ff0a0a40)
...etc...
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4011/head:pull/4011
$ git checkout pull/4011
Update a local copy of the PR:
$ git checkout pull/4011
$ git pull https://git.openjdk.java.net/jdk pull/4011/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4011
View PR using the GUI difftool:
$ git pr show -t 4011
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4011.diff