RFR: 8261098: Add clhsdb "findsym" command [v2]

Chris Plummer cjplummer at openjdk.java.net
Tue Feb 16 22:26:50 UTC 2021


On Tue, 16 Feb 2021 22:07:04 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> 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.
>
> 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)

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);

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

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


More information about the serviceability-dev mailing list