1 /* |
1 /* |
2 * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. |
3 * Copyright 2007, 2008, 2009 Red Hat, Inc. |
3 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
8 * published by the Free Software Foundation. |
8 * published by the Free Software Foundation. |
42 assert(!entry_frame_is_first(), "next Java fp must be non zero"); |
42 assert(!entry_frame_is_first(), "next Java fp must be non zero"); |
43 assert(entry_frame_call_wrapper()->anchor()->last_Java_sp() == sender_sp(), |
43 assert(entry_frame_call_wrapper()->anchor()->last_Java_sp() == sender_sp(), |
44 "sender should be next Java frame"); |
44 "sender should be next Java frame"); |
45 map->clear(); |
45 map->clear(); |
46 assert(map->include_argument_oops(), "should be set by clear"); |
46 assert(map->include_argument_oops(), "should be set by clear"); |
47 return frame(sender_sp(), sp() + 1); |
47 return frame(zeroframe()->next(), sender_sp()); |
48 } |
48 } |
49 |
49 |
50 frame frame::sender_for_nonentry_frame(RegisterMap *map) const { |
50 frame frame::sender_for_nonentry_frame(RegisterMap *map) const { |
51 assert(zeroframe()->is_interpreter_frame() || |
51 assert(zeroframe()->is_interpreter_frame() || |
52 zeroframe()->is_shark_frame() || |
52 zeroframe()->is_shark_frame() || |
53 zeroframe()->is_fake_stub_frame(), "wrong type of frame"); |
53 zeroframe()->is_fake_stub_frame(), "wrong type of frame"); |
54 return frame(sender_sp(), sp() + 1); |
54 return frame(zeroframe()->next(), sender_sp()); |
55 } |
55 } |
56 |
56 |
57 frame frame::sender(RegisterMap* map) const { |
57 frame frame::sender(RegisterMap* map) const { |
58 // Default is not to follow arguments; the various |
58 // Default is not to follow arguments; the various |
59 // sender_for_xxx methods update this accordingly. |
59 // sender_for_xxx methods update this accordingly. |
170 buflen >>= 1; |
170 buflen >>= 1; |
171 char *fieldbuf = buf; |
171 char *fieldbuf = buf; |
172 char *valuebuf = buf + buflen; |
172 char *valuebuf = buf + buflen; |
173 |
173 |
174 // Print each word of the frame |
174 // Print each word of the frame |
175 for (intptr_t *addr = fp(); addr <= sp(); addr++) { |
175 for (intptr_t *addr = sp(); addr <= fp(); addr++) { |
176 int offset = sp() - addr; |
176 int offset = fp() - addr; |
177 |
177 |
178 // Fill in default values, then try and improve them |
178 // Fill in default values, then try and improve them |
179 snprintf(fieldbuf, buflen, "word[%d]", offset); |
179 snprintf(fieldbuf, buflen, "word[%d]", offset); |
180 snprintf(valuebuf, buflen, PTR_FORMAT, *addr); |
180 snprintf(valuebuf, buflen, PTR_FORMAT, *addr); |
181 zeroframe()->identify_word(frame_index, offset, fieldbuf, valuebuf, buflen); |
181 zeroframe()->identify_word(frame_index, offset, fieldbuf, valuebuf, buflen); |