0004-Add-some-casts-for-building-on-musl.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From d41401ace01c234f42697e190a2ac95991780626 Mon Sep 17 00:00:00 2001
  2. From: Doug Evans <dje@google.com>
  3. Date: Mon, 26 Oct 2015 13:20:12 -0700
  4. Subject: [PATCH] Add some casts for building on musl.
  5. gdb/ChangeLog:
  6. * linux-thread-db.c (find_new_threads_callback): Cast ti.ti_tid to
  7. unsigned long for debug_printf.
  8. (thread_db_pid_to_str): Ditto.
  9. gdb/gdbserver/ChangeLog:
  10. * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
  11. for debug_printf.
  12. (attach_thread, find_new_threads_callback): Ditto.
  13. [Arnout: removed the parts that don't apply, including ChangeLog]
  14. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
  15. ---
  16. gdb/ChangeLog | 5 +++++
  17. gdb/gdbserver/ChangeLog | 6 ++++++
  18. gdb/gdbserver/thread-db.c | 9 +++++----
  19. gdb/linux-thread-db.c | 5 +++--
  20. 4 files changed, 19 insertions(+), 6 deletions(-)
  21. diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
  22. index ffe722d..3df10ff 100644
  23. --- a/gdb/gdbserver/thread-db.c
  24. +++ b/gdb/gdbserver/thread-db.c
  25. @@ -278,7 +278,7 @@ find_one_thread (ptid_t ptid)
  26. if (debug_threads)
  27. debug_printf ("Found thread %ld (LWP %d)\n",
  28. - ti.ti_tid, ti.ti_lid);
  29. + (unsigned long) ti.ti_tid, ti.ti_lid);
  30. if (lwpid != ti.ti_lid)
  31. {
  32. @@ -319,12 +319,12 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
  33. if (debug_threads)
  34. debug_printf ("Attaching to thread %ld (LWP %d)\n",
  35. - ti_p->ti_tid, ti_p->ti_lid);
  36. + (unsigned long) ti_p->ti_tid, ti_p->ti_lid);
  37. err = linux_attach_lwp (ptid);
  38. if (err != 0)
  39. {
  40. warning ("Could not attach to thread %ld (LWP %d): %s\n",
  41. - ti_p->ti_tid, ti_p->ti_lid,
  42. + (unsigned long) ti_p->ti_tid, ti_p->ti_lid,
  43. linux_attach_fail_reason_string (ptid, err));
  44. return 0;
  45. }
  46. diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
  47. index 66e9595..41db29a 100644
  48. --- a/gdb/linux-thread-db.c
  49. +++ b/gdb/linux-thread-db.c
  50. @@ -1816,7 +1817,7 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
  51. tid = thread_info->priv->tid;
  52. snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
  53. - tid, ptid_get_lwp (ptid));
  54. + (unsigned long) tid, ptid_get_lwp (ptid));
  55. return buf;
  56. }
  57. --
  58. 1.9.4