Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java @ 6842:b9a9ed0f8eeb
7197424: update copyright year to match last edit in jdk8 hotspot repository
Summary: Update copyright year to 2012 for relevant files
Reviewed-by: dholmes, coleenp
author | mikael |
---|---|
date | Tue, 09 Oct 2012 10:09:34 -0700 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.debugger.linux; | |
26 | |
27 import sun.jvm.hotspot.debugger.*; | |
28 | |
29 class LinuxThread implements ThreadProxy { | |
30 private LinuxDebugger debugger; | |
31 private int lwp_id; | |
32 | |
33 /** The address argument must be the address of the _thread_id in the | |
34 OSThread. It's value is result ::gettid() call. */ | |
35 LinuxThread(LinuxDebugger debugger, Address addr) { | |
36 this.debugger = debugger; | |
37 // FIXME: size of data fetched here should be configurable. | |
38 // However, making it so would produce a dependency on the "types" | |
39 // package from the debugger package, which is not desired. | |
40 this.lwp_id = (int) addr.getCIntegerAt(0, 4, true); | |
41 } | |
42 | |
43 LinuxThread(LinuxDebugger debugger, long id) { | |
44 this.debugger = debugger; | |
45 this.lwp_id = (int) id; | |
46 } | |
47 | |
48 public boolean equals(Object obj) { | |
49 if ((obj == null) || !(obj instanceof LinuxThread)) { | |
50 return false; | |
51 } | |
52 | |
53 return (((LinuxThread) obj).lwp_id == lwp_id); | |
54 } | |
55 | |
56 public int hashCode() { | |
57 return lwp_id; | |
58 } | |
59 | |
60 public String toString() { | |
61 return Integer.toString(lwp_id); | |
62 } | |
63 | |
64 public ThreadContext getContext() throws IllegalThreadStateException { | |
65 long[] data = debugger.getThreadIntegerRegisterSet(lwp_id); | |
66 ThreadContext context = LinuxThreadContextFactory.createThreadContext(debugger); | |
67 for (int i = 0; i < data.length; i++) { | |
68 context.setRegister(i, data[i]); | |
69 } | |
70 return context; | |
71 } | |
72 | |
73 public boolean canSetContext() throws DebuggerException { | |
74 return false; | |
75 } | |
76 | |
77 public void setContext(ThreadContext context) | |
78 throws IllegalThreadStateException, DebuggerException { | |
79 throw new DebuggerException("Unimplemented"); | |
80 } | |
81 } |