1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-23 07:57:38 +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:
homeip.net!davidm 2004-08-19 14:00:14 +00:00
parent 43425a9beb
commit 51ef1210e8

View file

@ -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. */ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "unwind_i.h" #include "unwind_i.h"
#include "ucontext_i.h"
#include <signal.h> #include <signal.h>
PROTECTED int PROTECTED int
@ -48,20 +49,16 @@ unw_step (unw_cursor_t *cursor)
else else
{ {
struct dwarf_loc rbp_loc, rsp_loc, rip_loc; struct dwarf_loc rbp_loc, rsp_loc, rip_loc;
struct ucontext *ucontext = (struct ucontext *)c->dwarf.cfa; unw_word_t ucontext = c->dwarf.cfa;
unw_word_t *uc_gregs = &ucontext->uc_mcontext.gregs[0];
Debug(1, "signal frame, skip over trampoline\n"); Debug(1, "signal frame, skip over trampoline\n");
c->sigcontext_format = X86_64_SCF_LINUX_RT_SIGFRAME; c->sigcontext_format = X86_64_SCF_LINUX_RT_SIGFRAME;
c->sigcontext_addr = c->dwarf.cfa; c->sigcontext_addr = c->dwarf.cfa;
#if 0 rsp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0);
/* XXX this needs to be fixed for cross-compilation --davidm */ rbp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RBP, 0);
rsp_loc = DWARF_LOC ((unw_word_t)&uc_gregs[REG_RSP], 0); rip_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RIP, 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
ret = dwarf_get (&c->dwarf, rsp_loc, &c->dwarf.cfa); ret = dwarf_get (&c->dwarf, rsp_loc, &c->dwarf.cfa);
if (ret < 0) if (ret < 0)