agent/src/os/win32/windbg/Makefile

Mon, 24 Sep 2012 12:44:00 -0700

author
minqi
date
Mon, 24 Sep 2012 12:44:00 -0700
changeset 4093
5a98bf7d847b
parent 1907
c18cbe5936b8
child 6876
710a3c8b516e
permissions
-rw-r--r--

6879063: SA should use hsdis for disassembly
Summary: We should in SA to use hsdis for it like the JVM does to replace the current java based disassembler.
Reviewed-by: twisti, jrose, sla
Contributed-by: yumin.qi@oracle.com

duke@435 1 #
minqi@4093 2 # Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
duke@435 22 #
duke@435 23 #
duke@435 24
duke@435 25 # set WINDBG_HOME and JAVA_HOME environment variables before this make.
duke@435 26
duke@435 27 SAWINDBGDLL = sawindbg.dll
duke@435 28 CPP32=cl.exe
duke@435 29 CPP64=cl.exe
duke@435 30 LINK32=link.exe
duke@435 31 LINK64=link.exe
duke@435 32 JAVAH=$(JAVA_HOME)/bin/javah
duke@435 33 WINDBG_INCLUDE=$(WINDBG_HOME)/sdk/inc
duke@435 34 WINDBG_LIB32=$(WINDBG_HOME)/sdk/lib/i386
duke@435 35 WINDBG_LIB_IA64=$(WINDBG_HOME)/sdk/lib/ia64
duke@435 36 WINDBG_LIB_AMD64=$(WINDBG_HOME)/sdk/lib/amd64
duke@435 37
minqi@4093 38 SADIS=../../../share/native/sadis.c
minqi@4093 39
duke@435 40 # These do not need to be optimized (don't run a lot of code) and it
duke@435 41 # will be useful to have the assertion checks in place
duke@435 42
duke@435 43 CFLAGS32=/nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
duke@435 44
duke@435 45 CFLAGS64=/nologo /MD /W3 /GX /Od /D "WIN32" /D "WIN64" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
duke@435 46
duke@435 47 LIBS32= $(WINDBG_LIB32)/dbgeng.lib \
duke@435 48 /nologo /subsystem:console /debug /machine:I386
duke@435 49
duke@435 50 LIBS_IA64= $(WINDBG_LIB_IA64)/dbgeng.lib \
duke@435 51 /nologo /subsystem:console /debug /machine:IA64
duke@435 52
duke@435 53 LIBS_AMD64= $(WINDBG_LIB_AMD64)/dbgeng.lib bufferoverflowU.lib \
duke@435 54 /nologo /subsystem:console /debug /machine:AMD64
duke@435 55
duke@435 56 default: i386/$(SAWINDBGDLL)
duke@435 57
duke@435 58 ia64: ia64/$(SAWINDBGDLL)
duke@435 59
duke@435 60 amd64: amd64/$(SAWINDBGDLL)
duke@435 61
minqi@4093 62 i386/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS)
duke@435 63 @ mkdir -p i386
minqi@4093 64 @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.x86.X86ThreadContext
minqi@4093 65 @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler
duke@435 66 @ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sawindbg.pch" /Fo"i386/" /Fd"i386/" /c sawindbg.cpp
minqi@4093 67 @ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sadis.pch" /Fo"i386/" /Fd"i386/" /c $(SADIS)
minqi@4093 68 $(LINK32) /out:$@ /DLL i386/sawindbg.obj i386/sadis.obj $(LIBS32)
duke@435 69
minqi@4093 70 ia64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS)
duke@435 71 @ mkdir -p ia64
duke@435 72 @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
minqi@4093 73 @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler
duke@435 74 @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sawindbg.pch" /Fo"ia64/" /Fd"ia64/" /c sawindbg.cpp
minqi@4093 75 @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sadis.pch" /Fo"ia64/" /Fd"ia64/" /c $(SADIS)
minqi@4093 76 $(LINK64) /out:$@ /DLL ia64/sawindbg.obj ia64/sadis.obj $(LIBS_IA64)
duke@435 77
minqi@4093 78 amd64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS)
duke@435 79 @ mkdir -p amd64
duke@435 80 @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
minqi@4093 81 @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler
duke@435 82 @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sawindbg.pch" /Fo"amd64/" /Fd"amd64/" /c sawindbg.cpp
minqi@4093 83 @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sadis.pch" /Fo"amd64/" /Fd"amd64/" /c $(SADIS)
minqi@4093 84 $(LINK64) /out:$@ /DLL amd64/sawindbg.obj amd64/sadis.obj $(LIBS_AMD64)
duke@435 85
duke@435 86 clean:
duke@435 87 rm *.h
duke@435 88 rm -rf i386
duke@435 89 rm -rf ia64
duke@435 90 rm -rf amd64
duke@435 91

mercurial