From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6DB1E3858C83 for ; Tue, 25 Apr 2023 13:59:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6DB1E3858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682431146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ATyf9YMTIodvqLvnjTPKVXzWndr2WVK1qfYcweKbD0w=; b=SJEGdai3ccvcNVFzIDC/x93RYtW9BihtjYmoHpWw3xgEylSmSa+B11u2kS0IrN2zTDMdu2 PWw24Xw1oPzRcPzOpYjHPbl5VUTp9SXliNPbSW+mnZAAByLbcZpYClUqpcP0wgQ+qIXlo5 mmRznNSs+Dl6g35q8M8wrwZQdr5oFxI= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-rYQ5XwX-OTKg0bqwY4Mqxw-1; Tue, 25 Apr 2023 09:59:00 -0400 X-MC-Unique: rYQ5XwX-OTKg0bqwY4Mqxw-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-2f446161e5aso3372271f8f.1 for ; Tue, 25 Apr 2023 06:58:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682431135; x=1685023135; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ATyf9YMTIodvqLvnjTPKVXzWndr2WVK1qfYcweKbD0w=; b=iTHWJqd6N+6H0w62fFgFgwTJNpZk9x0fz7kiZSKZpcyzVKRfw/AxlajDEKW+mIPs9i KGFg/oDjPtrgZMiIL6/F5VCz7P4/EQSyXoH88Kgjs9L3zK0BBcBMHOnIUf2Zhg63fz/k ELVJG1MfHMianiSm55oHd7yYd+9adV6pMXJ3CKn2uGvKz/hbCV+XduJHlG6swIY0G1RD 6IuQeRNMtBnL6r5agfeq8Ol+BgIaGhVqY3lpCgsiE9fLlYSUoNPa1aRuC8bQKmUmZTHR uW3WoNVh/YHuSeVu0scW3bBajRLe7W0KzGVoNm/FUGiX4MRVfCPwEFTmjlXWWomxyL1+ 99nA== X-Gm-Message-State: AAQBX9fvsZgsMDwm3A4m2G9gcDVIaDBZfaxoLHKnKQu2YO/rAe/UIhzO lCZlDwN9bAxBNGR+BwI0BS+Wy0h0tqP5gFl6VGnGh2E0cmCstPYqE1G36RR6KO6AnGyQeo5f2TR TlviEw+mzQLJZYjFLFZeZCK4kzqBLXg== X-Received: by 2002:adf:f6d0:0:b0:303:68d5:ff90 with SMTP id y16-20020adff6d0000000b0030368d5ff90mr10207497wrp.71.1682431135153; Tue, 25 Apr 2023 06:58:55 -0700 (PDT) X-Google-Smtp-Source: AKy350a7tLPfBirrmlLbtXnqiJf3F5g1tqr1IWQyLXGZg7WjQUZ5WRMvoN38kOxf6sFsYRnZh8gNfg== X-Received: by 2002:adf:f6d0:0:b0:303:68d5:ff90 with SMTP id y16-20020adff6d0000000b0030368d5ff90mr10207490wrp.71.1682431134815; Tue, 25 Apr 2023 06:58:54 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id x2-20020a5d60c2000000b002de9a0b0a20sm13114615wrt.113.2023.04.25.06.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 06:58:54 -0700 (PDT) From: Andrew Burgess To: Tankut Baris Aktemur , gdb-patches@sourceware.org Subject: Re: [PATCH] gdbserver: update the comment of 'current_process' In-Reply-To: <20230425120948.2604327-1-tankut.baris.aktemur@intel.com> References: <20230425120948.2604327-1-tankut.baris.aktemur@intel.com> Date: Tue, 25 Apr 2023 14:58:53 +0100 Message-ID: <87sfcoawrm.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tankut Baris Aktemur via Gdb-patches writes: > Since commit > > commit 7f8acedeebe295fc8cc1d11ed971cbfc1942618c > Author: Pedro Alves > Date: Tue Apr 5 13:57:11 2022 +0100 > > gdbserver: track current process as well as current thread > > current process is tracked separately and may be non-null > while the current thread is null. Update the comment of the > current_process function accordingly. > --- > gdbserver/inferiors.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gdbserver/inferiors.h b/gdbserver/inferiors.h > index a0ba9906097..9a41e66cb39 100644 > --- a/gdbserver/inferiors.h > +++ b/gdbserver/inferiors.h > @@ -92,9 +92,9 @@ pid_of (const process_info *proc) > return proc->pid; > } > > -/* Return a pointer to the process that corresponds to the current > - thread (current_thread). It is an error to call this if there is > - no current thread selected. */ > +/* Return a pointer to the current process. Note that the current > + process may be non-null while the current thread (current_thread) > + is null. */ I'm wondering if the bit about "It is an error to call this if there is no current thread selected." should be retained, or at least changed to "It is an error to call this if there is no current process selected." - and that the assert (removed in 7f8acedeebe295 should be added back. I've asked Pedro about this: https://sourceware.org/pipermail/gdb-patches/2023-April/199097.html Thanks, Andrew > > struct process_info *current_process (void); > struct process_info *get_thread_process (const struct thread_info *); > -- > 2.25.1 > > Intel Deutschland GmbH > Registered Address: Am Campeon 10, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928