From patchwork Mon Sep 8 15:25:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2680 Received: (qmail 6906 invoked by alias); 8 Sep 2014 15:41:09 -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 6884 invoked by uid 89); 8 Sep 2014 15:41:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 08 Sep 2014 15:41:04 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s88FPS6W019889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 8 Sep 2014 11:25:28 -0400 Received: from blade.nx (ovpn-116-108.ams2.redhat.com [10.36.116.108]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s88FPQxZ017274 for ; Mon, 8 Sep 2014 11:25:27 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 532302640F6 for ; Mon, 8 Sep 2014 16:25:25 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 07/14] Change signature of linux_target_ops.new_thread Date: Mon, 8 Sep 2014 16:25:15 +0100 Message-Id: <1410189922-18320-8-git-send-email-gbenson@redhat.com> In-Reply-To: <1410189922-18320-1-git-send-email-gbenson@redhat.com> References: <1410189922-18320-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This commit changes the signature of linux_target_ops.new_thread in gdbserver to match that used in GDB's equivalent. gdb/gdbserver/ChangeLog: * linux-low.h (linux_target_ops) : Changed signature. * linux-arm-low.c (arm_new_thread): Likewise. * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise. * linux-mips-low.c (mips_linux_new_thread): Likewise. * linux-x86-low.c (x86_linux_new_thread): Likewise. * linux-low.c (add_lwp): Update the_low_target.new_thread call. --- gdb/gdbserver/ChangeLog | 9 +++++++++ gdb/gdbserver/linux-aarch64-low.c | 6 +++--- gdb/gdbserver/linux-arm-low.c | 6 +++--- gdb/gdbserver/linux-low.c | 2 +- gdb/gdbserver/linux-low.h | 2 +- gdb/gdbserver/linux-mips-low.c | 6 +++--- gdb/gdbserver/linux-x86-low.c | 6 +++--- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index ca096b0..47920b1 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -1115,8 +1115,8 @@ aarch64_linux_new_process (void) /* Called when a new thread is detected. */ -static struct arch_lwp_info * -aarch64_linux_new_thread (void) +static void +aarch64_linux_new_thread (struct lwp_info *lwp) { struct arch_lwp_info *info = xcalloc (1, sizeof (*info)); @@ -1126,7 +1126,7 @@ aarch64_linux_new_thread (void) DR_MARK_ALL_CHANGED (info->dr_changed_bp, aarch64_num_bp_regs); DR_MARK_ALL_CHANGED (info->dr_changed_wp, aarch64_num_wp_regs); - return info; + lwp->arch_private = info; } /* Called when resuming a thread. diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index c4cfbd4..a7d0467 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -703,8 +703,8 @@ arm_new_process (void) } /* Called when a new thread is detected. */ -static struct arch_lwp_info * -arm_new_thread (void) +static void +arm_new_thread (struct lwp_info *lwp) { struct arch_lwp_info *info = xcalloc (1, sizeof (*info)); int i; @@ -714,7 +714,7 @@ arm_new_thread (void) for (i = 0; i < MAX_WPTS; i++) info->wpts_changed[i] = 1; - return info; + lwp->arch_private = info; } /* Called when resuming a thread. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index b1982be..c9a9952 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -556,7 +556,7 @@ add_lwp (ptid_t ptid) memset (lwp, 0, sizeof (*lwp)); if (the_low_target.new_thread != NULL) - lwp->arch_private = the_low_target.new_thread (); + the_low_target.new_thread (lwp); lwp->thread = add_thread (ptid, lwp); diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h index 697e0fb..5ef0807 100644 --- a/gdb/gdbserver/linux-low.h +++ b/gdb/gdbserver/linux-low.h @@ -184,7 +184,7 @@ struct linux_target_ops /* Hook to call when a new thread is detected. If extra per-thread architecture-specific data is needed, allocate it here. */ - struct arch_lwp_info * (*new_thread) (void); + void (*new_thread) (struct lwp_info *); /* Hook to call prior to resuming a thread. */ void (*prepare_to_resume) (struct lwp_info *); diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c index 377284b..cfc490d 100644 --- a/gdb/gdbserver/linux-mips-low.c +++ b/gdb/gdbserver/linux-mips-low.c @@ -334,14 +334,14 @@ mips_linux_new_process (void) Mark the watch registers as changed, so the threads' copies will be updated. */ -static struct arch_lwp_info * -mips_linux_new_thread (void) +static void +mips_linux_new_thread (struct lwp_info *lwp) { struct arch_lwp_info *info = xcalloc (1, sizeof (*info)); info->watch_registers_changed = 1; - return info; + lwp->arch_private = info; } /* This is the implementation of linux_target_ops method diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index ead70a0..c8d50a1 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -743,14 +743,14 @@ x86_linux_new_process (void) /* Called when a new thread is detected. */ -static struct arch_lwp_info * -x86_linux_new_thread (void) +static void +x86_linux_new_thread (struct lwp_info *lwp) { struct arch_lwp_info *info = XCNEW (struct arch_lwp_info); info->debug_registers_changed = 1; - return info; + lwp->arch_private = info; } /* See nat/x86-dregs.h. */