Mercurial > hg > graal-compiler
annotate agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java @ 8023:758935f7c23f
8006423: SA: NullPointerException in sun.jvm.hotspot.debugger.bsd.BsdThread.getContext(BsdThread.java:67)
Summary: Do not rely on mach thread port names to identify threads from SA
Reviewed-by: dholmes, minqi, rbackman
author | sla |
---|---|
date | Fri, 08 Feb 2013 12:48:24 +0100 |
parents | b9a9ed0f8eeb |
children |
rev | line source |
---|---|
3960 | 1 /* |
6842
b9a9ed0f8eeb
7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents:
6073
diff
changeset
|
2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. |
3960 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 * | |
23 */ | |
24 | |
25 package sun.jvm.hotspot.debugger.bsd; | |
26 | |
27 import sun.jvm.hotspot.debugger.*; | |
28 import sun.jvm.hotspot.debugger.bsd.amd64.*; | |
29 import sun.jvm.hotspot.debugger.bsd.x86.*; | |
30 | |
31 class BsdThreadContextFactory { | |
32 static ThreadContext createThreadContext(BsdDebugger dbg) { | |
33 String cpu = dbg.getCPU(); | |
34 if (cpu.equals("x86")) { | |
35 return new BsdX86ThreadContext(dbg); | |
6073
78d2ae5ab35b
7163117: Agent can't connect to process on Mac OSX
nloodin
parents:
3960
diff
changeset
|
36 } else if (cpu.equals("amd64") || cpu.equals("x86_64")) { |
3960 | 37 return new BsdAMD64ThreadContext(dbg); |
38 } else { | |
39 throw new RuntimeException("cpu " + cpu + " is not yet supported"); | |
40 } | |
41 } | |
42 } |