Fri, 04 Oct 2013 13:01:07 +0200
8016845: SA is unable to use hsdis on windows
Summary: Added sadis.c to the build to provide missing symbols in sawindbg.dll. Added code to use the correct hsdisXXX.dll filename on different windows platforms.
Reviewed-by: sla, mgerdin
Contributed-by: fredrik.arvidsson@oracle.com
agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java | file | annotate | diff | comparison | revisions | |
make/windows/makefiles/sa.make | file | annotate | diff | comparison | revisions |
1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java Fri Oct 04 12:45:39 2013 +0200 1.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java Fri Oct 04 13:01:07 2013 +0200 1.3 @@ -67,6 +67,13 @@ 1.4 String libname = "hsdis"; 1.5 String arch = System.getProperty("os.arch"); 1.6 if (os.lastIndexOf("Windows", 0) != -1) { 1.7 + if (arch.equals("x86")) { 1.8 + libname += "-i386"; 1.9 + } else if (arch.equals("amd64")) { 1.10 + libname += "-amd64"; 1.11 + } else { 1.12 + libname += "-" + arch; 1.13 + } 1.14 path.append(sep + "bin" + sep); 1.15 libname += ".dll"; 1.16 } else if (os.lastIndexOf("SunOS", 0) != -1) {
2.1 --- a/make/windows/makefiles/sa.make Fri Oct 04 12:45:39 2013 +0200 2.2 +++ b/make/windows/makefiles/sa.make Fri Oct 04 13:01:07 2013 +0200 2.3 @@ -102,7 +102,10 @@ 2.4 !if "$(MT)" != "" 2.5 SA_LD_FLAGS = -manifest $(SA_LD_FLAGS) 2.6 !endif 2.7 -SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp 2.8 + 2.9 +SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \ 2.10 + $(AGENT_DIR)/src/share/native/sadis.c 2.11 + 2.12 SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE) 2.13 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" 2.14 SA_LFLAGS = $(SA_LFLAGS) -map -debug 2.15 @@ -116,16 +119,16 @@ 2.16 # In VS2005 or VS2008 the link command creates a .manifest file that we want 2.17 # to insert into the linked artifact so we do not need to track it separately. 2.18 # Use ";#2" for .dll and ";#1" for .exe in the MT command below: 2.19 -$(SAWINDBG): $(SASRCFILE) 2.20 +$(SAWINDBG): $(SASRCFILES) 2.21 set INCLUDE=$(SA_INCLUDE)$(INCLUDE) 2.22 $(CXX) @<< 2.23 -I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32" 2.24 -I"$(GENERATED)" $(SA_CFLAGS) 2.25 - $(SASRCFILE) 2.26 + $(SASRCFILES) 2.27 -out:$*.obj 2.28 << 2.29 set LIB=$(SA_LIB)$(LIB) 2.30 - $(LD) -out:$@ -DLL $*.obj dbgeng.lib $(SA_LFLAGS) 2.31 + $(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS) 2.32 !if "$(MT)" != "" 2.33 $(MT) -manifest $(@F).manifest -outputresource:$(@F);#2 2.34 !endif