From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id L0RqOLeo2WHGWQAAWB0awg (envelope-from ) for ; Sat, 08 Jan 2022 10:07:35 -0500 Received: by simark.ca (Postfix, from userid 112) id D69DA1EE1A; Sat, 8 Jan 2022 10:07:35 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 822271EA69 for ; Sat, 8 Jan 2022 10:07:33 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9A13385782A for ; Sat, 8 Jan 2022 15:07:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9A13385782A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641654452; bh=6GRgRJR1pysJobVOzFUgvwem6bxh1eldLbgoWSu7Gmo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ypjZJr8G7kxdZXwhovO2NmX0gm2whva4ZERSRwpVcb9MQJtPjRIbTx9SyvrsfP78J 23nSA+iBzwWjKroFM3iP6uY0R1rCfX0IL2e4TTykG45u2N072wrtK6FGTHgfTThVaS L80qlPY7ZTjYn+EC3vp+60WTA6CyVii+VeqtNl8A= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 1F3D1385840D for ; Sat, 8 Jan 2022 15:07:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F3D1385840D Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:3675:495b:d016:4ce1]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 74F33830F2; Sat, 8 Jan 2022 15:07:10 +0000 (UTC) Date: Sat, 8 Jan 2022 15:07:06 +0000 To: Tom Tromey Subject: Re: [PATCH 1/2] Introduce target_announce_attach Message-ID: <20220108150641.eefdfocex34schl7@Plymouth> References: <20220105175916.2969966-1-tom@tromey.com> <20220105175916.2969966-2-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220105175916.2969966-2-tom@tromey.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Sat, 08 Jan 2022 15:07:10 +0000 (UTC) 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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > +/* See target.h */ > + > +void > +target_announce_attach (int from_tty, int pid) > +{ > + if (!from_tty) > + return; > + > + const char *exec_file = get_exec_file (0); > + > + if (exec_file) Hi, Just a nit, and I know you just moved this bit of code around, but shouldn't this become if (exec_file != nullptr) ? Lancelot. > + printf_unfiltered ("Attaching to program: %s, %s\n", exec_file, > + target_pid_to_str (ptid_t (pid)).c_str ()); > + else > + printf_unfiltered ("Attaching to %s\n", > + target_pid_to_str (ptid_t (pid)).c_str ()); > +} > + > /* The inferior process has died. Long live the inferior! */