mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-15 20:58:13 +01:00
Include ucontext_i.h.
(unw_step): Fixup signal-frame-skipping code so it can be cross-compiled. (Logical change 1.251)
This commit is contained in:
parent
43425a9beb
commit
51ef1210e8
1 changed files with 5 additions and 8 deletions
|
@ -26,6 +26,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#include "unwind_i.h"
|
||||
#include "ucontext_i.h"
|
||||
#include <signal.h>
|
||||
|
||||
PROTECTED int
|
||||
|
@ -48,20 +49,16 @@ unw_step (unw_cursor_t *cursor)
|
|||
else
|
||||
{
|
||||
struct dwarf_loc rbp_loc, rsp_loc, rip_loc;
|
||||
struct ucontext *ucontext = (struct ucontext *)c->dwarf.cfa;
|
||||
unw_word_t *uc_gregs = &ucontext->uc_mcontext.gregs[0];
|
||||
unw_word_t ucontext = c->dwarf.cfa;
|
||||
|
||||
Debug(1, "signal frame, skip over trampoline\n");
|
||||
|
||||
c->sigcontext_format = X86_64_SCF_LINUX_RT_SIGFRAME;
|
||||
c->sigcontext_addr = c->dwarf.cfa;
|
||||
|
||||
#if 0
|
||||
/* XXX this needs to be fixed for cross-compilation --davidm */
|
||||
rsp_loc = DWARF_LOC ((unw_word_t)&uc_gregs[REG_RSP], 0);
|
||||
rbp_loc = DWARF_LOC ((unw_word_t)&uc_gregs[REG_RBP], 0);
|
||||
rip_loc = DWARF_LOC ((unw_word_t)&uc_gregs[REG_RIP], 0);
|
||||
#endif
|
||||
rsp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0);
|
||||
rbp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RBP, 0);
|
||||
rip_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RIP, 0);
|
||||
|
||||
ret = dwarf_get (&c->dwarf, rsp_loc, &c->dwarf.cfa);
|
||||
if (ret < 0)
|
||||
|
|
Loading…
Reference in a new issue