From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33130 invoked by alias); 31 Mar 2017 17:15:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32915 invoked by uid 89); 31 Mar 2017 17:15:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f43.google.com Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Mar 2017 17:15:37 +0000 Received: by mail-wm0-f43.google.com with SMTP id x124so4116517wmf.0 for ; Fri, 31 Mar 2017 10:15:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=UjtEGJrMqXfGOM1B3dZcPG9jbjad2P6pg+tEhZuxYug=; b=i/5TiX0CX0pu8TO74IrMYRVED1DMF7AGnPkNZiGmUHNHsvwXAEzwHeuBvl0HfLsyu9 JAbRn0iSc1NZ+/SMNkUpjcx7AwbkbIWiuhQ6KuU0O/ICbRQzmmGtU4kN0fbgClQc1M3X t3GqCP7vQ4MUgHZn4uFxXWkmkc3XTGf2sFLXlLDozlD4893fRGWT96xHmv461PvFr4xY eFYbwkNZkyfIK+s6a81Nd26oN0NQ2oVGhJdnH88oigQ8AzMW/h80Q4SaahT0vQlY8RaP QpKx8nL8QhcoTS2bpuz6h+3HRLWwenRnEx6ZARQcbvhR7yeV4fQvNWhoDcPfayaK05Aa fv6g== X-Gm-Message-State: AFeK/H2Jx7Xs/67Squ6F/xUei0JNXt5hhJx/Qf6FkuQtj/IIfYgCuJpGWM5NZozOYX6Wmhs6 X-Received: by 10.28.229.78 with SMTP id c75mr4052416wmh.20.1490980536438; Fri, 31 Mar 2017 10:15:36 -0700 (PDT) Received: from [192.168.0.101] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id 65sm7431430wri.68.2017.03.31.10.15.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 10:15:35 -0700 (PDT) Subject: Re: [PATCH v5 2/5] Share parts of gdb/gdbthread.h with gdbserver To: Sergio Durigan Junior , GDB Patches References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <20170330014915.4894-1-sergiodj@redhat.com> <20170330014915.4894-3-sergiodj@redhat.com> From: Pedro Alves Message-ID: Date: Fri, 31 Mar 2017 17:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170330014915.4894-3-sergiodj@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00550.txt.bz2 On 03/30/2017 02:49 AM, Sergio Durigan Junior wrote: > +struct thread_info * > +add_thread_silent (ptid_t ptid) > +{ > + pid_t pid = ptid_get_pid (ptid); > + > + /* Check if there is a process already. */ > + if (find_process_pid (pid) == NULL) > + add_process (pid, 0); > + > + return add_thread (ptid_build (pid, pid, 0), NULL); This ptid_build here is always using the "pid" as lwpid. This suggests to me that "add_thread_silent" was not the right function entry point to share, since we're adding a hack to one of the implementations. Either we need a new function, like "add_initial_thread (pid_t pid)", or maybe we could move the add_thread_silent call in fork_inferior to the gdb-side, only? Thanks, Pedro Alves