JDK-8250801 : Add clhsdb "threadcontext" command
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: svc-agent
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-29
  • Updated: 2022-10-28
  • Resolved: 2022-01-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19 b06Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
SA has the ability to fetch the thread's registers via the thread context. It would be nice to allow access to the registers from clhsdb. This plays in well with the enhancements being done to PointerFinder as part of JDK-8247514. Many of the register values will then be automatically displayed as symbols, Methods, Threads, stack offsets, nmethods, interpreter codelets, etc.

During some recent debugging I did I found it useful to dump a thread's registers in this manner. Although in this case I was inlining the code in the part of SA where I wanted to see the registers, having it as a clhsdb command would not only be useful to user, but also useful when debugging SA because it would serve as a code snippet to copy-n-paste where needed.

Proposal for the syntax is the same as for the "thread" command:

    threadcontext [-v] { -a | id }

Where -a displays all threads, and "id" is used to display a specific thread.  -v just means more verbose output, whereas without it for the most part each register printed will just take up one line. I've implemented this and it was trivial, although I still need to come up with a test case.
Comments
Changeset: bdfa15d9 Author: Chris Plummer <cjplummer@openjdk.org> Date: 2022-01-18 19:21:13 +0000 URL: https://git.openjdk.java.net/jdk/commit/bdfa15d92cb0e795d04431f82168644dee2da128
18-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/6925 Date: 2021-12-23 04:06:58 +0000
23-12-2021