hotspot/src/share/vm/compiler/disassembler.cpp
changeset 33583 af842015bfaa
parent 31592 43f48e165466
child 33585 3121a0276778
equal deleted inserted replaced
32954:7db0663a5e96 33583:af842015bfaa
    86   char ebuf[1024];
    86   char ebuf[1024];
    87   char buf[JVM_MAXPATHLEN];
    87   char buf[JVM_MAXPATHLEN];
    88   os::jvm_path(buf, sizeof(buf));
    88   os::jvm_path(buf, sizeof(buf));
    89   int jvm_offset = -1;
    89   int jvm_offset = -1;
    90   int lib_offset = -1;
    90   int lib_offset = -1;
       
    91 #ifdef STATIC_BUILD
       
    92   char* p = strrchr(buf, '/');
       
    93   *p = '\0';
       
    94   strcat(p, "/lib/");
       
    95   lib_offset = jvm_offset = strlen(buf);
       
    96 #else
    91   {
    97   {
    92     // Match "jvm[^/]*" in jvm_path.
    98     // Match "jvm[^/]*" in jvm_path.
    93     const char* base = buf;
    99     const char* base = buf;
    94     const char* p = strrchr(buf, *os::file_separator());
   100     const char* p = strrchr(buf, *os::file_separator());
    95     if (p != NULL) lib_offset = p - base + 1;
   101     if (p != NULL) lib_offset = p - base + 1;
    96     p = strstr(p ? p : base, "jvm");
   102     p = strstr(p ? p : base, "jvm");
    97     if (p != NULL)  jvm_offset = p - base;
   103     if (p != NULL)  jvm_offset = p - base;
    98   }
   104   }
       
   105 #endif
    99   // Find the disassembler shared library.
   106   // Find the disassembler shared library.
   100   // Search for several paths derived from libjvm, in this order:
   107   // Search for several paths derived from libjvm, in this order:
   101   // 1. <home>/jre/lib/<arch>/<vm>/libhsdis-<arch>.so  (for compatibility)
   108   // 1. <home>/jre/lib/<arch>/<vm>/libhsdis-<arch>.so  (for compatibility)
   102   // 2. <home>/jre/lib/<arch>/<vm>/hsdis-<arch>.so
   109   // 2. <home>/jre/lib/<arch>/<vm>/hsdis-<arch>.so
   103   // 3. <home>/jre/lib/<arch>/hsdis-<arch>.so
   110   // 3. <home>/jre/lib/<arch>/hsdis-<arch>.so