From 776ca611521876003b3d73b9735187b156d004c2 Mon Sep 17 00:00:00 2001 From: sla Date: Fri, 4 Oct 2013 13:01:07 +0200 Subject: [PATCH] 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 --- .../classes/sun/jvm/hotspot/asm/Disassembler.java | 7 +++++++ make/windows/makefiles/sa.make | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java index f6a279dee..9d351cb09 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +++ b/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java @@ -67,6 +67,13 @@ public class Disassembler { String libname = "hsdis"; String arch = System.getProperty("os.arch"); if (os.lastIndexOf("Windows", 0) != -1) { + if (arch.equals("x86")) { + libname += "-i386"; + } else if (arch.equals("amd64")) { + libname += "-amd64"; + } else { + libname += "-" + arch; + } path.append(sep + "bin" + sep); libname += ".dll"; } else if (os.lastIndexOf("SunOS", 0) != -1) { diff --git a/make/windows/makefiles/sa.make b/make/windows/makefiles/sa.make index 4137122f2..c04e36309 100644 --- a/make/windows/makefiles/sa.make +++ b/make/windows/makefiles/sa.make @@ -102,7 +102,10 @@ SA_CFLAGS = $(SA_CFLAGS) -ZI !if "$(MT)" != "" SA_LD_FLAGS = -manifest $(SA_LD_FLAGS) !endif -SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp + +SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \ + $(AGENT_DIR)/src/share/native/sadis.c + SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE) !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" SA_LFLAGS = $(SA_LFLAGS) -map -debug @@ -116,16 +119,16 @@ SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG) # In VS2005 or VS2008 the link command creates a .manifest file that we want # to insert into the linked artifact so we do not need to track it separately. # Use ";#2" for .dll and ";#1" for .exe in the MT command below: -$(SAWINDBG): $(SASRCFILE) +$(SAWINDBG): $(SASRCFILES) set INCLUDE=$(SA_INCLUDE)$(INCLUDE) $(CXX) @<< -I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32" -I"$(GENERATED)" $(SA_CFLAGS) - $(SASRCFILE) + $(SASRCFILES) -out:$*.obj << set LIB=$(SA_LIB)$(LIB) - $(LD) -out:$@ -DLL $*.obj dbgeng.lib $(SA_LFLAGS) + $(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS) !if "$(MT)" != "" $(MT) -manifest $(@F).manifest -outputresource:$(@F);#2 !endif -- GitLab