From patchwork Tue Jan 12 16:28:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 10350 Received: (qmail 104874 invoked by alias); 12 Jan 2016 16:28:20 -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 104860 invoked by uid 89); 12 Jan 2016 16:28:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2468, 3207 X-HELO: mail-pf0-f170.google.com Received: from mail-pf0-f170.google.com (HELO mail-pf0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 12 Jan 2016 16:28:18 +0000 Received: by mail-pf0-f170.google.com with SMTP id 65so65206933pff.2 for ; Tue, 12 Jan 2016 08:28:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=TscRAhFSPaBX013RGE76Muzpq/o17R/Z4iV7fgUoS2E=; b=AASKxIqDjQwGkp5uNHUyyKpOKuJwBisUT7NFKO7Apn+IOZLX7D+xPbmaWZAr+47uYB jGyob/5cF4VdaU9H58KmGs4NG71wOKgDZY8FETgNjxS6ioSoRCwkd5MLqLSDx6iMImfq ++VwXKniXH4zdaH2zl/siuLwrrp+5nTI5FdvOg0HlruV3A+GL9oPRSS9v1k/r3lwvWS0 DrjnB4O12H+iIg1zM8J0In043HT+pty3BPm21G3zFrWrrucYVctxttR7XLWDlK2ddAvD DCC+4dsL7bq5sgPIk+XGd4BRWVsr0soY+gvIUcVsLngw2CaRGJS3q55HX828LSzuoCX0 GnXA== X-Gm-Message-State: ALoCoQlTbPqzQagi42Xyka2jFiMBC0Va/vkToFa3edMnLjQqSlUprvwTfX79A85k/5XRfT6g0kdkIkKIi/+ld3Yqye9KLws1hQ== X-Received: by 10.98.42.213 with SMTP id q204mr35743001pfq.141.1452616096180; Tue, 12 Jan 2016 08:28:16 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id g87sm31502115pfj.1.2016.01.12.08.28.13 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 12 Jan 2016 08:28:15 -0800 (PST) From: Yao Qi To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Change function signature passed to clone References: <1452264350-25126-1-git-send-email-yao.qi@linaro.org> Date: Tue, 12 Jan 2016 16:28:06 +0000 In-Reply-To: <1452264350-25126-1-git-send-email-yao.qi@linaro.org> (Yao Qi's message of "Fri, 8 Jan 2016 14:45:50 +0000") Message-ID: <86mvsavk2x.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Yao Qi writes: > diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c > index f25abcf..31757ee 100644 > --- a/gdb/nat/linux-ptrace.c > +++ b/gdb/nat/linux-ptrace.c > @@ -261,7 +261,7 @@ linux_ptrace_test_ret_to_nx (void) > FUNCTION). For MMU targets, CHILD_STACK is ignored. */ > > static int > -linux_fork_to_function (gdb_byte *child_stack, void (*function) (gdb_byte *)) > +linux_fork_to_function (gdb_byte *child_stack, int (*function) (void *)) > { > int child_pid; > > @@ -298,8 +298,8 @@ linux_fork_to_function (gdb_byte *child_stack, void (*function) (gdb_byte *)) > /* A helper function for linux_check_ptrace_features, called after > the child forks a grandchild. */ > > -static void > -linux_grandchild_function (gdb_byte *child_stack) > +static int > +linux_grandchild_function (void *child_stack) > { > /* Free any allocated stack. */ > xfree (child_stack); > @@ -313,8 +313,8 @@ linux_grandchild_function (gdb_byte *child_stack) > the parent process forks a child. The child allows itself to > be traced by its parent. */ > > -static void > -linux_child_function (gdb_byte *child_stack) > +static int > +linux_child_function (void *child_stack) > { > ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0); > kill (getpid (), SIGSTOP); This patch causes a C++ build error. Patch below fixes it. diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c index 31757ee..0eaf9a3 100644 --- a/gdb/nat/linux-ptrace.c +++ b/gdb/nat/linux-ptrace.c @@ -320,7 +320,7 @@ linux_child_function (void *child_stack) kill (getpid (), SIGSTOP); /* Fork a grandchild. */ - linux_fork_to_function (child_stack, linux_grandchild_function); + linux_fork_to_function ((gdb_byte *) child_stack, linux_grandchild_function); /* This code is only reacheable by the child (grandchild's parent) process. */