package/gdb: switch to 7.11 as the default version
[buildroot-gz.git] / package / gdb / 7.9.1 / 0005-Add-some-casts-for-building-on-musl.patch
blob2469eb79a472b22009707fa3223705c149ad2f03
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.
6 gdb/ChangeLog:
8 * linux-thread-db.c (find_new_threads_callback): Cast ti.ti_tid to
9 unsigned long for debug_printf.
10 (thread_db_pid_to_str): Ditto.
12 gdb/gdbserver/ChangeLog:
14 * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
15 for debug_printf.
16 (attach_thread, find_new_threads_callback): Ditto.
18 [Arnout: removed the parts that don't apply, including ChangeLog]
19 Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
20 ---
21 gdb/ChangeLog | 5 +++++
22 gdb/gdbserver/ChangeLog | 6 ++++++
23 gdb/gdbserver/thread-db.c | 9 +++++----
24 gdb/linux-thread-db.c | 5 +++--
25 4 files changed, 19 insertions(+), 6 deletions(-)
27 diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
28 index ffe722d..3df10ff 100644
29 --- a/gdb/gdbserver/thread-db.c
30 +++ b/gdb/gdbserver/thread-db.c
31 @@ -278,7 +278,7 @@ find_one_thread (ptid_t ptid)
33 if (debug_threads)
34 debug_printf ("Found thread %ld (LWP %d)\n",
35 - ti.ti_tid, ti.ti_lid);
36 + (unsigned long) ti.ti_tid, ti.ti_lid);
38 if (lwpid != ti.ti_lid)
40 @@ -319,12 +319,12 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
42 if (debug_threads)
43 debug_printf ("Attaching to thread %ld (LWP %d)\n",
44 - ti_p->ti_tid, ti_p->ti_lid);
45 + (unsigned long) ti_p->ti_tid, ti_p->ti_lid);
46 err = linux_attach_lwp (ptid);
47 if (err != 0)
49 warning ("Could not attach to thread %ld (LWP %d): %s\n",
50 - ti_p->ti_tid, ti_p->ti_lid,
51 + (unsigned long) ti_p->ti_tid, ti_p->ti_lid,
52 linux_ptrace_attach_fail_reason_string (ptid, err));
53 return 0;
55 diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
56 index 66e9595..41db29a 100644
57 --- a/gdb/linux-thread-db.c
58 +++ b/gdb/linux-thread-db.c
59 @@ -1816,7 +1817,7 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
61 tid = thread_info->priv->tid;
62 snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
63 - tid, ptid_get_lwp (ptid));
64 + (unsigned long) tid, ptid_get_lwp (ptid));
66 return buf;
68 --
69 1.9.4