patch-src_x86_Gos-linux_c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- libunwind-1.2.orig/src/x86/Gos-linux.c 2016-11-18 04:28:29.000000000 +0100
  2. +++ libunwind-1.2/src/x86/Gos-linux.c 2017-04-17 18:57:50.832552016 +0200
  3. @@ -26,6 +26,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
  4. #include "unwind_i.h"
  5. #include "offsets.h"
  6. +#include <sys/syscall.h>
  7. +
  8. PROTECTED int
  9. unw_is_signal_frame (unw_cursor_t *cursor)
  10. {
  11. @@ -283,26 +285,16 @@ HIDDEN int
  12. x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
  13. {
  14. struct cursor *c = (struct cursor *) cursor;
  15. - ucontext_t *uc = c->uc;
  16. -
  17. - /* Ensure c->pi is up-to-date. On x86, it's relatively common to be
  18. - missing DWARF unwind info. We don't want to fail in that case,
  19. - because the frame-chain still would let us do a backtrace at
  20. - least. */
  21. - dwarf_make_proc_info (&c->dwarf);
  22. -
  23. - if (unlikely (c->sigcontext_format != X86_SCF_NONE))
  24. - {
  25. - struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr;
  26. + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr;
  27. - Debug (8, "resuming at ip=%x via sigreturn(%p)\n", c->dwarf.ip, sc);
  28. - sigreturn (sc);
  29. - }
  30. - else
  31. - {
  32. - Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip);
  33. - setcontext (uc);
  34. - }
  35. + Debug (8, "resuming at ip=%llx via sigreturn(%p)\n",
  36. + (unsigned long long) c->dwarf.ip, sc);
  37. + __asm__ __volatile__ (
  38. + "int $0x80"
  39. + : "=r" (sc)
  40. + : "0"(SYS_rt_sigreturn)
  41. + : "memory"
  42. + );
  43. return -UNW_EINVAL;
  44. }
  45. #endif