mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-27 01:27:39 +01:00
Update copyright year.
Minor formatting changes. (Logical change 1.110)
This commit is contained in:
parent
c55348de6e
commit
6b6a0079e6
1 changed files with 18 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
||||||
/* libunwind - a platform-independent unwind library
|
/* libunwind - a platform-independent unwind library
|
||||||
Copyright (C) 2002 Hewlett-Packard Co
|
Copyright (C) 2002-2003 Hewlett-Packard Co
|
||||||
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||||
|
|
||||||
This file is part of libunwind.
|
This file is part of libunwind.
|
||||||
|
@ -121,15 +121,12 @@ unw_step (unw_cursor_t *cursor)
|
||||||
struct cursor *c = (struct cursor *) cursor;
|
struct cursor *c = (struct cursor *) cursor;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
||||||
if (unw_is_signal_frame(cursor))
|
if (unw_is_signal_frame(cursor))
|
||||||
{
|
{
|
||||||
/* Without SA_SIGINFO, */
|
/* c->esp points at the arguments to the handler. Without
|
||||||
/* c -> esp points at the arguments to the handler. */
|
SA_SIGINFO, the arguments consist of a signal number followed
|
||||||
/* This consists of a signal number followed by a */
|
by a struct sigcontext. With SA_SIGINFO, the arguments
|
||||||
/* struct sigcontext. */
|
consist a signal number, a siginfo *, and a ucontext *. */
|
||||||
/* With SA_SIGINFO, the arguments consists of the */
|
|
||||||
/* signal number, a siginfo *, and a ucontext * . */
|
|
||||||
unw_word_t siginfo_ptr_addr = c->esp + 4;
|
unw_word_t siginfo_ptr_addr = c->esp + 4;
|
||||||
unw_word_t sigcontext_ptr_addr = c->esp + 8;
|
unw_word_t sigcontext_ptr_addr = c->esp + 8;
|
||||||
unw_word_t siginfo_ptr, sigcontext_ptr;
|
unw_word_t siginfo_ptr, sigcontext_ptr;
|
||||||
|
@ -138,29 +135,29 @@ unw_step (unw_cursor_t *cursor)
|
||||||
siginfo_ptr_loc = X86_LOC (siginfo_ptr_addr, 0);
|
siginfo_ptr_loc = X86_LOC (siginfo_ptr_addr, 0);
|
||||||
sigcontext_ptr_loc = X86_LOC (sigcontext_ptr_addr, 0);
|
sigcontext_ptr_loc = X86_LOC (sigcontext_ptr_addr, 0);
|
||||||
ret = (x86_get (c, siginfo_ptr_loc, &siginfo_ptr)
|
ret = (x86_get (c, siginfo_ptr_loc, &siginfo_ptr)
|
||||||
| x86_get (c, sigcontext_ptr_loc, &sigcontext_ptr));
|
| x86_get (c, sigcontext_ptr_loc, &sigcontext_ptr));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (siginfo_ptr < c -> esp || siginfo_ptr > c -> esp + 256
|
if (siginfo_ptr < c->esp || siginfo_ptr > c->esp + 256
|
||||||
|| sigcontext_ptr < c -> esp || sigcontext_ptr > c -> esp + 256)
|
|| sigcontext_ptr < c->esp || sigcontext_ptr > c->esp + 256)
|
||||||
{
|
{
|
||||||
/* Not plausible for SA_SIGINFO signal */
|
/* Not plausible for SA_SIGINFO signal */
|
||||||
unw_word_t sigcontext_addr = c->esp + 4;
|
unw_word_t sigcontext_addr = c->esp + 4;
|
||||||
esp_loc = X86_LOC (sigcontext_addr + LINUX_SC_ESP_OFF, 0);
|
esp_loc = X86_LOC (sigcontext_addr + LINUX_SC_ESP_OFF, 0);
|
||||||
c->ebp_loc = X86_LOC (sigcontext_addr + LINUX_SC_EBP_OFF, 0);
|
c->ebp_loc = X86_LOC (sigcontext_addr + LINUX_SC_EBP_OFF, 0);
|
||||||
c->eip_loc = X86_LOC (sigcontext_addr + LINUX_SC_EIP_OFF, 0);
|
c->eip_loc = X86_LOC (sigcontext_addr + LINUX_SC_EIP_OFF, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If SA_SIGINFO were not specified, we actually read */
|
/* If SA_SIGINFO were not specified, we actually read
|
||||||
/* various segment pointers instead. We believe that at */
|
various segment pointers instead. We believe that at
|
||||||
/* least fs and _fsh are always zero for linux, so it is */
|
least fs and _fsh are always zero for linux, so it is not
|
||||||
/* is not just unlikely, but impossible that we would end up */
|
just unlikely, but impossible that we would end up
|
||||||
/* here. */
|
here. */
|
||||||
esp_loc = X86_LOC (sigcontext_ptr + LINUX_UC_ESP_OFF, 0);
|
esp_loc = X86_LOC (sigcontext_ptr + LINUX_UC_ESP_OFF, 0);
|
||||||
c->ebp_loc = X86_LOC (sigcontext_ptr + LINUX_UC_EBP_OFF, 0);
|
c->ebp_loc = X86_LOC (sigcontext_ptr + LINUX_UC_EBP_OFF, 0);
|
||||||
c->eip_loc = X86_LOC (sigcontext_ptr + LINUX_UC_EIP_OFF, 0);
|
c->eip_loc = X86_LOC (sigcontext_ptr + LINUX_UC_EIP_OFF, 0);
|
||||||
}
|
}
|
||||||
ret = x86_get (c, esp_loc, &c->esp);
|
ret = x86_get (c, esp_loc, &c->esp);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue