Gresume.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* libunwind - a platform-independent unwind library
  2. Copyright (C) 2006-2007 IBM
  3. Contributed by
  4. Corey Ashford cjashfor@us.ibm.com
  5. Jose Flavio Aguilar Paulino <jflavio@br.ibm.com> <joseflavio@gmail.com>
  6. This file is part of libunwind.
  7. Permission is hereby granted, free of charge, to any person obtaining
  8. a copy of this software and associated documentation files (the
  9. "Software"), to deal in the Software without restriction, including
  10. without limitation the rights to use, copy, modify, merge, publish,
  11. distribute, sublicense, and/or sell copies of the Software, and to
  12. permit persons to whom the Software is furnished to do so, subject to
  13. the following conditions:
  14. The above copyright notice and this permission notice shall be
  15. included in all copies or substantial portions of the Software.
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  23. #include <stdlib.h>
  24. #include "unwind_i.h"
  25. #ifndef UNW_REMOTE_ONLY
  26. #include <sys/syscall.h>
  27. /* sigreturn() is a no-op on x86_64 glibc. */
  28. static NORETURN inline long
  29. my_rt_sigreturn (void *new_sp)
  30. {
  31. /* XXX: empty stub. */
  32. abort ();
  33. }
  34. HIDDEN inline int
  35. ppc32_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
  36. {
  37. /* XXX: empty stub. */
  38. return -UNW_EINVAL;
  39. }
  40. #endif /* !UNW_REMOTE_ONLY */
  41. /* This routine is responsible for copying the register values in
  42. cursor C and establishing them as the current machine state. */
  43. static inline int
  44. establish_machine_state (struct cursor *c)
  45. {
  46. /* XXX: empty stub. */
  47. return 0;
  48. }
  49. PROTECTED int
  50. unw_resume (unw_cursor_t *cursor)
  51. {
  52. struct cursor *c = (struct cursor *) cursor;
  53. int ret;
  54. Debug (1, "(cursor=%p)\n", c);
  55. if ((ret = establish_machine_state (c)) < 0)
  56. return ret;
  57. return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c,
  58. c->dwarf.as_arg);
  59. }