Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java @ 3960:f08d439fab8c
7089790: integrate bsd-port changes
Reviewed-by: kvn, twisti, jrose
Contributed-by: Kurt Miller <kurt@intricatesoftware.com>, Greg Lewis <glewis@eyesbeyond.com>, Jung-uk Kim <jkim@freebsd.org>, Christos Zoulas <christos@zoulas.com>, Landon Fuller <landonf@plausible.coop>, The FreeBSD Foundation <board@freebsdfoundation.org>, Michael Franz <mvfranz@gmail.com>, Roger Hoover <rhoover@apple.com>, Alexander Strange <astrange@apple.com>
author | never |
---|---|
date | Sun, 25 Sep 2011 16:03:29 -0700 |
parents | f6f3bb0ee072 |
children | 78d2ae5ab35b |
comparison
equal
deleted
inserted
replaced
3959:eda6988c0d81 | 3960:f08d439fab8c |
---|---|
27 import java.io.PrintStream; | 27 import java.io.PrintStream; |
28 import java.net.*; | 28 import java.net.*; |
29 import java.rmi.*; | 29 import java.rmi.*; |
30 import sun.jvm.hotspot.*; | 30 import sun.jvm.hotspot.*; |
31 import sun.jvm.hotspot.debugger.*; | 31 import sun.jvm.hotspot.debugger.*; |
32 import sun.jvm.hotspot.debugger.bsd.*; | |
32 import sun.jvm.hotspot.debugger.proc.*; | 33 import sun.jvm.hotspot.debugger.proc.*; |
33 import sun.jvm.hotspot.debugger.cdbg.*; | 34 import sun.jvm.hotspot.debugger.cdbg.*; |
34 import sun.jvm.hotspot.debugger.windbg.*; | 35 import sun.jvm.hotspot.debugger.windbg.*; |
35 import sun.jvm.hotspot.debugger.linux.*; | 36 import sun.jvm.hotspot.debugger.linux.*; |
36 import sun.jvm.hotspot.debugger.sparc.*; | 37 import sun.jvm.hotspot.debugger.sparc.*; |
512 setupDebuggerSolaris(); | 513 setupDebuggerSolaris(); |
513 } else if (os.equals("win32")) { | 514 } else if (os.equals("win32")) { |
514 setupDebuggerWin32(); | 515 setupDebuggerWin32(); |
515 } else if (os.equals("linux")) { | 516 } else if (os.equals("linux")) { |
516 setupDebuggerLinux(); | 517 setupDebuggerLinux(); |
518 } else if (os.equals("bsd")) { | |
519 setupDebuggerBsd(); | |
517 } else { | 520 } else { |
518 // Add support for more operating systems here | 521 // Add support for more operating systems here |
519 throw new DebuggerException("Operating system " + os + " not yet supported"); | 522 throw new DebuggerException("Operating system " + os + " not yet supported"); |
520 } | 523 } |
521 if (isServer) { | 524 if (isServer) { |
562 } else if (os.equals("win32")) { | 565 } else if (os.equals("win32")) { |
563 db = new HotSpotTypeDataBase(machDesc, new Win32VtblAccess(debugger, jvmLibNames), | 566 db = new HotSpotTypeDataBase(machDesc, new Win32VtblAccess(debugger, jvmLibNames), |
564 debugger, jvmLibNames); | 567 debugger, jvmLibNames); |
565 } else if (os.equals("linux")) { | 568 } else if (os.equals("linux")) { |
566 db = new HotSpotTypeDataBase(machDesc, new LinuxVtblAccess(debugger, jvmLibNames), | 569 db = new HotSpotTypeDataBase(machDesc, new LinuxVtblAccess(debugger, jvmLibNames), |
570 debugger, jvmLibNames); | |
571 } else if (os.equals("bsd")) { | |
572 db = new HotSpotTypeDataBase(machDesc, new BsdVtblAccess(debugger, jvmLibNames), | |
567 debugger, jvmLibNames); | 573 debugger, jvmLibNames); |
568 } else { | 574 } else { |
569 throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess implemented yet)"); | 575 throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess implemented yet)"); |
570 } | 576 } |
571 } | 577 } |
664 setupJVMLibNamesSolaris(); | 670 setupJVMLibNamesSolaris(); |
665 } else if (os.equals("win32")) { | 671 } else if (os.equals("win32")) { |
666 setupJVMLibNamesWin32(); | 672 setupJVMLibNamesWin32(); |
667 } else if (os.equals("linux")) { | 673 } else if (os.equals("linux")) { |
668 setupJVMLibNamesLinux(); | 674 setupJVMLibNamesLinux(); |
675 } else if (os.equals("bsd")) { | |
676 setupJVMLibNamesBsd(); | |
669 } else { | 677 } else { |
670 throw new RuntimeException("Unknown OS type"); | 678 throw new RuntimeException("Unknown OS type"); |
671 } | 679 } |
672 | 680 |
673 cpu = debugger.getCPU(); | 681 cpu = debugger.getCPU(); |
743 private void setupJVMLibNamesLinux() { | 751 private void setupJVMLibNamesLinux() { |
744 // same as solaris | 752 // same as solaris |
745 setupJVMLibNamesSolaris(); | 753 setupJVMLibNamesSolaris(); |
746 } | 754 } |
747 | 755 |
756 // | |
757 // BSD | |
758 // | |
759 | |
760 private void setupDebuggerBsd() { | |
761 setupJVMLibNamesBsd(); | |
762 | |
763 if (cpu.equals("x86")) { | |
764 machDesc = new MachineDescriptionIntelX86(); | |
765 } else if (cpu.equals("amd64")) { | |
766 machDesc = new MachineDescriptionAMD64(); | |
767 } else { | |
768 throw new DebuggerException("Bsd only supported on x86/amd64"); | |
769 } | |
770 | |
771 // Note we do not use a cache for the local debugger in server | |
772 // mode; it will be taken care of on the client side (once remote | |
773 // debugging is implemented). | |
774 | |
775 debugger = new BsdDebuggerLocal(machDesc, !isServer); | |
776 attachDebugger(); | |
777 } | |
778 | |
779 private void setupJVMLibNamesBsd() { | |
780 // same as solaris | |
781 setupJVMLibNamesSolaris(); | |
782 } | |
783 | |
748 /** Convenience routine which should be called by per-platform | 784 /** Convenience routine which should be called by per-platform |
749 debugger setup. Should not be called when startupMode is | 785 debugger setup. Should not be called when startupMode is |
750 REMOTE_MODE. */ | 786 REMOTE_MODE. */ |
751 private void attachDebugger() { | 787 private void attachDebugger() { |
752 if (startupMode == PROCESS_MODE) { | 788 if (startupMode == PROCESS_MODE) { |