0002-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 963843d4d07aef6caa296dacf191f8adc9518596 Mon Sep 17 00:00:00 2001
  2. From: Doug Evans <dje@google.com>
  3. Date: Mon, 26 Oct 2015 13:24:01 -0700
  4. Subject: [PATCH] musl: Move W_STOPCODE to common/gdb_wait.h.
  5. gdb/ChangeLog:
  6. * common/gdb_wait.h (W_STOPCODE): Define, moved here from
  7. gdbserver/linux-low.c.
  8. (WSETSTOP): Simplify.
  9. gdb/gdbserver/ChangeLog:
  10. * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
  11. [Arnout: removed the parts that don't apply, including ChangeLog]
  12. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
  13. ---
  14. gdb/ChangeLog | 6 ++++++
  15. gdb/common/gdb_wait.h | 8 ++++----
  16. gdb/gdbserver/ChangeLog | 4 ++++
  17. gdb/gdbserver/linux-low.c | 4 ----
  18. 4 files changed, 14 insertions(+), 8 deletions(-)
  19. diff --git a/gdb/common/gdb_wait.h b/gdb/common/gdb_wait.h
  20. index 9b250d2..412f813 100644
  21. --- a/gdb/common/gdb_wait.h
  22. +++ b/gdb/common/gdb_wait.h
  23. @@ -85,12 +85,12 @@
  24. # endif
  25. #endif
  26. +#ifndef W_STOPCODE
  27. +#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
  28. +#endif
  29. +
  30. #ifndef WSETSTOP
  31. -# ifdef W_STOPCODE
  32. #define WSETSTOP(w,sig) ((w) = W_STOPCODE(sig))
  33. -# else
  34. -#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
  35. -# endif
  36. #endif
  37. /* For native GNU/Linux we may use waitpid and the __WCLONE option.
  38. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
  39. index 0c552b8..7ed67c7 100644
  40. --- a/gdb/gdbserver/linux-low.c
  41. +++ b/gdb/gdbserver/linux-low.c
  42. @@ -70,10 +70,6 @@
  43. #define O_LARGEFILE 0
  44. #endif
  45. -#ifndef W_STOPCODE
  46. -#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
  47. -#endif
  48. -
  49. /* This is the kernel's hard limit. Not to be confused with
  50. SIGRTMIN. */
  51. #ifndef __SIGRTMIN
  52. --
  53. 1.9.4