From patchwork Fri Oct 23 16:50:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 9343 Received: (qmail 5140 invoked by alias); 23 Oct 2015 16:50:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5124 invoked by uid 89); 23 Oct 2015 16:50:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK, URIBL_JP_SURBL autolearn=no version=3.3.2 X-HELO: mail-pa0-f73.google.com Received: from mail-pa0-f73.google.com (HELO mail-pa0-f73.google.com) (209.85.220.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 23 Oct 2015 16:50:58 +0000 Received: by pacev6 with SMTP id ev6so18384445pac.0 for ; Fri, 23 Oct 2015 09:50:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to :content-type; bh=mMgk5jIbV9JNlif9Ot6TG+hjM/LCJnYaQ1r2RFZqO7s=; b=ZSzc3Kyt1RZOEoYJP2Ctt8unLp1r7zT2ceOzyJktIEGCTblsX49A+jF+1X9uH+k6Aw MHI9nZtQFIFZX3xbwX5RvA+R0kafClvXFjECVUQw+xH5AFDDkfoeuuZIaWWPCJ1ypKLM W2bb79IvYbkLbN5/Q06bzuvHAO0uywcWYFO63fezU7gBv5vilTGHK29t+2hJl8ZlELwy Q+XPgXAwTE9dZ0WEms59ec8WzA0W3THRr6mVOgtzbepx+HPSbYpx7/uQg4JkFkh3BDmz H3uKWEnhNPcPqbvMvfmiYhpnVr+CUU7mGQBsZB5HG3MQJmDhFj9OAhKEMUWbGfQSB9J1 I1eQ== X-Gm-Message-State: ALoCoQnl6PeBVi53m8/aQaiawq9vai6UBKczJgnGmbLWcWabPu3N/yiDwtcJyD4saWMIPPlJ3tVagTJ0UlUhV5yHJxiZCRPTq1kxwEZoKN4zAZd0bPYMiA55EXUaeped4MH5YRjlQujrBDGha1kaM9jCNmkUHf8s28a+i5heFTlkqJ7P7XS+EH0= MIME-Version: 1.0 X-Received: by 10.68.68.202 with SMTP id y10mr18031891pbt.0.1445619055866; Fri, 23 Oct 2015 09:50:55 -0700 (PDT) Message-ID: <001a113807e84e8bf10522c86ad7@google.com> Date: Fri, 23 Oct 2015 16:50:55 +0000 Subject: [PATCH 1/4] building gdb on musl From: Doug Evans To: gdb-patches@sourceware.org X-IsSubscribed: yes Hi. musl is a replacement for glibc. http://www.musl-libc.org/intro.html This patch series lets gdb build. This patch provides a set of casts for some printfs to avoid format complaints. There's also an issue that sometimes we're using %ld and sometimes we're using 0x%lx - I prefer 0x%lx, but since that's a separate issue it is left for a separate patch (I'm not intending to write one soon though). 2015-10-23 Doug Evans * gdbserver/thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long for debug_printf. (attach_thread, find_new_threads_callback): Ditto. * linux-thread-db.c (find_new_threads_callback): Ditto. (thread_db_pid_to_str): Ditto. @@ -1816,7 +1817,7 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid) tid = thread_info->priv->tid; snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", - tid, ptid_get_lwp (ptid)); + (unsigned long) tid, ptid_get_lwp (ptid)); return buf; } diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index ffe722d..3df10ff 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -278,7 +278,7 @@ find_one_thread (ptid_t ptid) if (debug_threads) debug_printf ("Found thread %ld (LWP %d)\n", - ti.ti_tid, ti.ti_lid); + (unsigned long) ti.ti_tid, ti.ti_lid); if (lwpid != ti.ti_lid) { @@ -319,12 +319,12 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) if (debug_threads) debug_printf ("Attaching to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); + (unsigned long) ti_p->ti_tid, ti_p->ti_lid); err = linux_attach_lwp (ptid); if (err != 0) { warning ("Could not attach to thread %ld (LWP %d): %s\n", - ti_p->ti_tid, ti_p->ti_lid, + (unsigned long) ti_p->ti_tid, ti_p->ti_lid, linux_ptrace_attach_fail_reason_string (ptid, err)); return 0; } @@ -392,7 +392,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) glibc PR17707. */ if (debug_threads) debug_printf ("thread_db: skipping exited and " - "joined thread (0x%lx)\n", ti.ti_tid); + "joined thread (0x%lx)\n", + (unsigned long) ti.ti_tid); return 0; } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 66e9595..41db29a 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1585,7 +1585,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) if (libthread_db_debug) fprintf_unfiltered (gdb_stdlog, "thread_db: skipping exited and " - "joined thread (0x%lx)\n", ti.ti_tid); + "joined thread (0x%lx)\n", + (unsigned long) ti.ti_tid); return 0; }