Skip to content
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

8261098: Add clhsdb "findsym" command #2567

Closed
wants to merge 3 commits into from

Conversation

plummercj
Copy link
Contributor

@plummercj plummercj commented Feb 15, 2021

Add "findsym" to clhsdb. See the CR and CSR for details. The CSR still needs a reviewer.

There is a fix in LinuxDebuggerLocal_lookupByName0() to allow passing in NULL for the dso name. This is allowed, and in fact even not null it gets ignored. It is needed by the new findsym support in order for the following to work, which passes in null for the dso name:

Address addr = VM.getVM().getDebugger().lookup(null, symbol);

There is one other somewhat unrelated fix in the test:

 -            String value = parts[1];
 +           String value = parts[1].split(linesep)[0];

This is suppose to capture just the value at the specified address, but it also captures the newline and some text after. The result if that when findpc <value> is executed, it also executes another command or two of garbage commands after that, which produce errors. They were not impacting the test, but were noticeable in the log. I first noticed it when similar code in the new part of the test had the same issue.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2567/head:pull/2567
$ git checkout pull/2567

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Feb 15, 2021

👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Feb 15, 2021
@plummercj
Copy link
Contributor Author

@plummercj plummercj commented Feb 15, 2021

/csr JDK-8261101

@openjdk
Copy link

@openjdk openjdk bot commented Feb 15, 2021

@plummercj The following label will be automatically applied to this pull request:

  • serviceability

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.

@openjdk openjdk bot added the serviceability label Feb 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 15, 2021

@plummercj usage: /csr [needed|unneeded], requires that the issue the pull request refers to links to an approved CSR request.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 15, 2021

Webrevs

@plummercj
Copy link
Contributor Author

@plummercj plummercj commented Feb 15, 2021

/csr needed

@openjdk openjdk bot added the csr label Feb 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 15, 2021

@plummercj this pull request will not be integrated until the CSR request JDK-8261101 for issue JDK-8261098 has been approved.

CHECK_EXCEPTION_(0);
// Note, objectName is ignored, and may in fact be NULL.
// lookup_symbol will always search all objects/libs
//AutoJavaString objectName_cstr(env, objectName);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to update AutoJavaString class to handle null strings:
m_buf(str == NULL ? NULL : env->GetStringUTFChars(str, NULL))

Copy link
Contributor Author

@plummercj plummercj Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is the argument is ignored, so it doesn't really matter if AutoJavaString can handle NULL. I assume with your suggested fix that also want me to pass objectName_cstr to lookup_symbol() rather than an explicit NULL. I wanted the NULL to be explicit to help further convey that objectName is ignored.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lookup_symbol implementation contains FIXME comment about object_name.
I suppose you want to make this argument ignorance permanent. Then I think this FIXME should be removed (or updated) and it would be nice to add comment about this to lookup_symbol declaration (or maybe it would be better to delete this argument)

Copy link
Contributor Author

@plummercj plummercj Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the FIXME in lookup_symbol was ever addressed, then we would need for NULL to mean to search all libraries. I suppose in that case it would make sense for AutoJavaString to do as you suggested. It looks like Windows also has an AutoJavaString. I'll change it also, but it is never passed NULL. The Bsd version is, but it handles the GetStringUTFChars() inline without AutoJavaString, and it does support NULL already:

  objectName_cstr = NULL;
  if (objectName != NULL) {
    objectName_cstr = (*env)->GetStringUTFChars(env, objectName, &isCopy);
    CHECK_EXCEPTION_(0);
  }
...
  addr = (jlong) lookup_symbol(ph, objectName_cstr, symbolName_cstr);

Copy link
Contributor Author

@plummercj plummercj Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed the AutoJavaString change.

@openjdk openjdk bot removed the csr label Feb 17, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 17, 2021

@plummercj 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:

8261098: Add clhsdb "findsym" command

Reviewed-by: amenkov, sspitsyn

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 46 new commits pushed to the master branch:

  • ea5bf45: 8261621: Delegate Unicode history from JLS to j.l.Character
  • d5a4d22: 8261843: incorrect info in docs/building.html
  • bf75a3a: 8261851: update ReflectionCallerCacheTest.java test to use ForceGC from test library
  • 05301f5: 8257497: Update keytool to create AKID from the SKID of the issuing certificate as specified by RFC 5280
  • cb84539: 8261553: Efficient mask generation using BMI2 BZHI instruction
  • a065879: 8261791: (sctp) handleSendFailed in SctpChannelImpl.c potential leaks
  • 9ba2b71: 8261657: [PPC64] Cleanup StoreCM nodes after CMS removal
  • f639df4: 8261401: Add sanity check for UseSHM large pages similar to the one used with hugetlb large pages
  • 2e18b52: 8261752: Multiple GC test are missing memory requirements
  • c7885eb: 8261758: [TESTBUG] gc/g1/TestGCLogMessages.java fails if ergonomics detect too small InitialHeapSize
  • ... and 36 more: https://git.openjdk.java.net/jdk/compare/e29c560a11c4cbc261bdd04db5d24170fb9f12b6...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Feb 17, 2021
Copy link
Contributor

@sspitsyn sspitsyn left a comment

It looks good to me.

@plummercj
Copy link
Contributor Author

@plummercj plummercj commented Feb 19, 2021

/integrate

@openjdk openjdk bot closed this Feb 19, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Feb 19, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 19, 2021

@plummercj Since your change was applied there have been 59 commits pushed to the master branch:

  • 0c31d5b: 8261977: Fix comment for getPrefixed() in canonicalize_md.c
  • 9cf4f90: 8261473: Shenandoah: Add breakpoint support
  • c4664e6: 8261940: Fix references to IOException in BigDecimal javadoc
  • 0e9c5ae: 8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF
  • e9f3aab: 8261912: Code IfNode::fold_compares_helper more defensively
  • fd098e7: 8261838: Shenandoah: reconsider heap region iterators memory ordering
  • f94a845: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values
  • 1a7adc8: 8260416: Remove unused method ReferenceProcessor::is_mt_processing_set_up()
  • 3a21e1d: 8260653: Unreachable nodes keep speculative types alive
  • b695c7e: 8261925: ProblemList com/sun/jdi/AfterThreadDeathTest.java on Linux
  • ... and 49 more: https://git.openjdk.java.net/jdk/compare/e29c560a11c4cbc261bdd04db5d24170fb9f12b6...master

Your commit was automatically rebased without conflicts.

Pushed as commit c158413.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@plummercj plummercj deleted the 8261098-findsym branch Mar 12, 2021
@plummercj plummercj restored the 8261098-findsym branch Mar 12, 2021
@plummercj plummercj deleted the 8261098-findsym branch Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated serviceability
3 participants