equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright (c) 2016, 2017 SAP SE. All rights reserved. |
3 * Copyright (c) 2016, 2018 SAP SE. All rights reserved. |
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. |
106 |
106 |
107 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) { |
107 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) { |
108 uc->uc_mcontext.psw.addr = (unsigned long)pc; |
108 uc->uc_mcontext.psw.addr = (unsigned long)pc; |
109 } |
109 } |
110 |
110 |
|
111 static address ucontext_get_lr(const ucontext_t * uc) { |
|
112 return (address)uc->uc_mcontext.gregs[14/*LINK*/]; |
|
113 } |
|
114 |
111 intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) { |
115 intptr_t* os::Linux::ucontext_get_sp(const ucontext_t * uc) { |
112 return (intptr_t*)uc->uc_mcontext.gregs[15/*REG_SP*/]; |
116 return (intptr_t*)uc->uc_mcontext.gregs[15/*REG_SP*/]; |
113 } |
117 } |
114 |
118 |
115 intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) { |
119 intptr_t* os::Linux::ucontext_get_fp(const ucontext_t * uc) { |
163 // Not sure where the pc points to, fallback to default |
167 // Not sure where the pc points to, fallback to default |
164 // stack overflow handling. In compiled code, we bang before |
168 // stack overflow handling. In compiled code, we bang before |
165 // the frame is complete. |
169 // the frame is complete. |
166 return false; |
170 return false; |
167 } else { |
171 } else { |
168 intptr_t* fp = os::Linux::ucontext_get_fp(uc); |
|
169 intptr_t* sp = os::Linux::ucontext_get_sp(uc); |
172 intptr_t* sp = os::Linux::ucontext_get_sp(uc); |
170 *fr = frame(sp, (address)*sp); |
173 address lr = ucontext_get_lr(uc); |
|
174 *fr = frame(sp, lr); |
171 if (!fr->is_java_frame()) { |
175 if (!fr->is_java_frame()) { |
172 assert(fr->safe_for_sender(thread), "Safety check"); |
176 assert(fr->safe_for_sender(thread), "Safety check"); |
173 assert(!fr->is_first_frame(), "Safety check"); |
177 assert(!fr->is_first_frame(), "Safety check"); |
174 *fr = fr->java_sender(); |
178 *fr = fr->java_sender(); |
175 } |
179 } |