From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by sourceware.org (Postfix) with ESMTPS id 035C03858D28 for ; Fri, 3 Dec 2021 17:01:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 035C03858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f47.google.com with SMTP id 77-20020a1c0450000000b0033123de3425so5415120wme.0 for ; Fri, 03 Dec 2021 09:01:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=tefzcKLGpV6p0/Qj36DIS47cSm5ZYqMh0ze3Bc/MBwI=; b=FK064/LOR6vflEzoaCHr8cy015kHq3Mtgd8gkg9vspVas+lD+ehydyZp8bUuV1MnyB 37NQgCvDecBaGLqwIvZSLjFF9dTalwNdwVpe1+No2NNqukuHlbSYU/KjR21NQQdetvea CRUmi4Ui+twwp8jiRfViFktDKlDtpTPMjZgfnmadip+cIrWzxYZEMIuYkQaxkNKfWt/4 dr4L09WnteXbTb69U3AyKZx9hztvBY1UAl4Wc+1VicslBSYLwuwkYqYlZEitGIAAzVIT LCQddgr6ZR6AdJYI1QTaF7id88YdGN7kvONJjK1ZQXqmAQZFuUqXkM8823IZmvUd4G62 7GHw== X-Gm-Message-State: AOAM530I2668YxbG0pDDacNX0FDMYGClMvXfEfkonpOQqJfwa5y3pRCZ yZ0QJs8/U9mblDsUnYC7znI/dylyhJo= X-Google-Smtp-Source: ABdhPJzGdaN6l0CzDFYTq/+7UXjcYuGzQ6XNO2EjihL1EE0Jm45aIMVIoxDy1jtWH9siLNOiGrIDfw== X-Received: by 2002:a05:600c:22d9:: with SMTP id 25mr16103855wmg.71.1638550865008; Fri, 03 Dec 2021 09:01:05 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:fb57:3faf:e98:b979? ([2001:8a0:f912:1a00:fb57:3faf:e98:b979]) by smtp.gmail.com with ESMTPSA id p62sm3148925wmp.10.2021.12.03.09.01.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Dec 2021 09:01:03 -0800 (PST) Message-ID: Date: Fri, 3 Dec 2021 17:01:02 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 2/3] gdbserver: replace direct assignments to current_thread Content-Language: en-US To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: <1a42560f8493577f704e945f735457b129c94406.1638380465.git.tankut.baris.aktemur@intel.com> From: Pedro Alves In-Reply-To: <1a42560f8493577f704e945f735457b129c94406.1638380465.git.tankut.baris.aktemur@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2021 17:01:11 -0000 On 2021-12-01 17:49, Tankut Baris Aktemur via Gdb-patches wrote: > Replace the direct assignments to current_thread with > switch_to_thread. Use scoped_restore_current_thread when appropriate. > There is one instance remaining in linux-low.cc's wait_for_sigstop. > This will be handled in a separate patch. > > Regression-tested on X86-64 Linux using the native-gdbserver and > native-extended-gdbserver board files. Cool, thanks! > @@ -1971,10 +1957,7 @@ linux_process_target::low_get_thread_area (int lwpid, CORE_ADDR *addrp) > bool > linux_process_target::maybe_move_out_of_jump_pad (lwp_info *lwp, int *wstat) > { > - struct thread_info *saved_thread; > - > - saved_thread = current_thread; > - current_thread = get_lwp_thread (lwp); > + switch_to_thread (get_lwp_thread (lwp)); Aren't we missing a scoped_restore here? The rest of the patch looked fine.