comparison agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java @ 6641:a9fed06c01d2

7154641: Servicability agent should work on platforms other than x86, sparc Summary: Added capability to load support classes for other cpus Reviewed-by: coleenp, bobv, sla Contributed-by: Bill Pittore <bill.pittore@oracle.com>
author bpittore
date Thu, 30 Aug 2012 11:20:01 -0400
parents 78d2ae5ab35b
children 8e47bac5643a
comparison
equal deleted inserted replaced
6640:e2cc1fe53845 6641:a9fed06c01d2
1 /* 1 /*
2 * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
24 24
25 package sun.jvm.hotspot.debugger.remote; 25 package sun.jvm.hotspot.debugger.remote;
26 26
27 import java.rmi.*; 27 import java.rmi.*;
28 import java.util.*; 28 import java.util.*;
29 import java.lang.reflect.*;
29 30
30 import sun.jvm.hotspot.debugger.*; 31 import sun.jvm.hotspot.debugger.*;
31 import sun.jvm.hotspot.debugger.cdbg.*; 32 import sun.jvm.hotspot.debugger.cdbg.*;
32 import sun.jvm.hotspot.debugger.remote.sparc.*; 33 import sun.jvm.hotspot.debugger.remote.sparc.*;
33 import sun.jvm.hotspot.debugger.remote.x86.*; 34 import sun.jvm.hotspot.debugger.remote.x86.*;
68 threadFactory = new RemoteAMD64ThreadFactory(this); 69 threadFactory = new RemoteAMD64ThreadFactory(this);
69 cachePageSize = 4096; 70 cachePageSize = 4096;
70 cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); 71 cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
71 unalignedAccessesOkay = true; 72 unalignedAccessesOkay = true;
72 } else { 73 } else {
73 throw new DebuggerException("Thread access for CPU architecture " + cpu + " not yet supported"); 74 try {
75 Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." +
76 cpu.toLowerCase() + ".Remote" + cpu.toUpperCase() +
77 "ThreadFactory");
78 Constructor[] ctf = tf.getConstructors();
79 threadFactory = (RemoteThreadFactory)ctf[0].newInstance(this);
80 } catch (Exception e) {
81 throw new DebuggerException("Thread access for CPU architecture " + cpu + " not yet supported");
82 }
83 cachePageSize = 4096;
84 cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
85 unalignedAccessesOkay = false;
74 } 86 }
75 87
76 // Cache portion of the remote process's address space. 88 // Cache portion of the remote process's address space.
77 initCache(cachePageSize, cacheNumPages); 89 initCache(cachePageSize, cacheNumPages);
78 90