annotate src/cpu/sparc/vm/debug_sparc.cpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents da91efe96a93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "code/codeCache.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "code/nmethod.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "runtime/frame.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "runtime/init.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "runtime/os.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "utilities/debug.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "utilities/top.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 extern "C" void findpc(int x);
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 void pd_ps(frame f) {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 intptr_t* sp = f.sp();
a61af66fc99e Initial load
duke
parents:
diff changeset
41 intptr_t* prev_sp = sp - 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 intptr_t *pc = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 intptr_t *next_pc = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 int count = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 tty->print("register window backtrace from %#x:\n", sp);
a61af66fc99e Initial load
duke
parents:
diff changeset
46 while (sp != NULL && ((intptr_t)sp & 7) == 0 && sp > prev_sp && sp < prev_sp+1000) {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 pc = next_pc;
a61af66fc99e Initial load
duke
parents:
diff changeset
48 next_pc = (intptr_t*) sp[I7->sp_offset_in_saved_window()];
a61af66fc99e Initial load
duke
parents:
diff changeset
49 tty->print("[%d] sp=%#x pc=", count, sp);
a61af66fc99e Initial load
duke
parents:
diff changeset
50 findpc((intptr_t)pc);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 if (WizardMode && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // print register window contents also
a61af66fc99e Initial load
duke
parents:
diff changeset
53 tty->print_cr(" L0..L7: {%#x %#x %#x %#x %#x %#x %#x %#x}",
a61af66fc99e Initial load
duke
parents:
diff changeset
54 sp[0+0],sp[0+1],sp[0+2],sp[0+3],
a61af66fc99e Initial load
duke
parents:
diff changeset
55 sp[0+4],sp[0+5],sp[0+6],sp[0+7]);
a61af66fc99e Initial load
duke
parents:
diff changeset
56 tty->print_cr(" I0..I7: {%#x %#x %#x %#x %#x %#x %#x %#x}",
a61af66fc99e Initial load
duke
parents:
diff changeset
57 sp[8+0],sp[8+1],sp[8+2],sp[8+3],
a61af66fc99e Initial load
duke
parents:
diff changeset
58 sp[8+4],sp[8+5],sp[8+6],sp[8+7]);
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // (and print stack frame contents too??)
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 CodeBlob *b = CodeCache::find_blob((address) pc);
a61af66fc99e Initial load
duke
parents:
diff changeset
62 if (b != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 if (b->is_nmethod()) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
64 Method* m = ((nmethod*)b)->method();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
65 int nlocals = m->max_locals();
a61af66fc99e Initial load
duke
parents:
diff changeset
66 int nparams = m->size_of_parameters();
a61af66fc99e Initial load
duke
parents:
diff changeset
67 tty->print_cr("compiled java method (locals = %d, params = %d)", nlocals, nparams);
a61af66fc99e Initial load
duke
parents:
diff changeset
68 }
a61af66fc99e Initial load
duke
parents:
diff changeset
69 }
a61af66fc99e Initial load
duke
parents:
diff changeset
70 }
a61af66fc99e Initial load
duke
parents:
diff changeset
71 prev_sp = sp;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 sp = (intptr_t *)sp[FP->sp_offset_in_saved_window()];
a61af66fc99e Initial load
duke
parents:
diff changeset
73 sp = (intptr_t *)((intptr_t)sp + STACK_BIAS);
a61af66fc99e Initial load
duke
parents:
diff changeset
74 count += 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76 if (sp != NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
77 tty->print("[%d] sp=%#x [bogus sp!]", count, sp);
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 #endif // PRODUCT