RFR: 8250801: Add clhsdb "threadcontext" command [v2]

Chris Plummer cjplummer at openjdk.java.net
Sun Jan 2 00:56:49 UTC 2022


> 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.
> 
> The syntax is:
> 
>     threadcontext [-v] { -a | id }
> 
> Where -a displays all threads, and "id" is used to display a specific thread. This is the same argument syntax as some other commands that let  you choose all threads or just one thread, such as the "thread" and "where" commands. -v just means more verbose output, whereas without it for the most part each register printed will just take up one line.

Chris Plummer has updated the pull request incrementally with four additional commits since the last revision:

 - Update the copyright this time.
 - Really update the copyright this time.
 - Update copyright and only print the register name.
 - Update copyright and remove @bug reference

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6925/files
  - new: https://git.openjdk.java.net/jdk/pull/6925/files/936b5579..417dd9cb

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6925&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6925&range=00-01

  Stats: 5 lines in 3 files changed: 0 ins; 1 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6925.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6925/head:pull/6925

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


More information about the serviceability-dev mailing list