From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id D3A443858C20 for ; Thu, 8 Jun 2023 20:16:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3A443858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-33b6c47898dso4963995ab.0 for ; Thu, 08 Jun 2023 13:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1686255365; x=1688847365; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=07pPPzgI82OGKa5iieEvXnVSsKJ9PLSR4Y2uputHo/0=; b=LWB4h1QauFcNtz61mB0CLdtte1R4y2OAsU96xxAKGi5N0KN9Xa1J+PYaHOUHDjLHyS whSSQ44A/fwd6X/BrHYcvjyhougkus/UMx9vrarfxUk5BnveFYWbxdvCAaYsfoatRRao nPqcRAZHborOtNohrJcfljT4Cr3JFio6VbzYxESQXXQX780rqEv1Mw73408sRxMDBzoP LQCNN9FQYU0WeWgFLmqIw/8NdO4gIbjrpL+vrUn+YHs3WzrI9tpMUTQSi+oMoIRFlax6 hcHhGjW8E+gUqGxcuI4Ikad6006ZvXmOv8wcGK7vQPkCduPpnwr6Thkdu3SmvF7/BeU6 5BOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686255365; x=1688847365; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=07pPPzgI82OGKa5iieEvXnVSsKJ9PLSR4Y2uputHo/0=; b=H7l1HVaqpO13CejPzaQ9ZLfXk+t8Xo92OO4a3YUWqyEUBx+Is7cAHU1/2m5Y9dqVvK i8TKNChizECLeLoEXh4TzWCxGsuUX4s6Tf2hOysO35q/UfKG83jTOPIt94dWbmxQJhLm WI+hAQFTURRytdWKjJyKdAQcqVCA0AuPGtJ4jBoYWsrhXbLaYHAijT9dLHw7FN4P6DFa eeguh/+geIq8l8WeR24QkAzghF0jI419JbyuaAtMDuuJrNzB8Hop1gxG5KIli0PdBVTI GDPi1cXTncvrAOeQ0X5um4U8o0VR78ntWoEn9n1fmBzlx0/hJwvVR9wEf67dJaZCdZBK zg1w== X-Gm-Message-State: AC+VfDyMMmEdKBPix3STWy5hYy8jtDdpqxJkT7E9ncnP0u+iyI7g5Jm1 RWQASirEDk8ca/UKTZuQGParsw== X-Google-Smtp-Source: ACHHUZ7buOM404hdoSVvzLuEQpRciN1lPQnZB4D3RImG0WJiyX/ZWLD+8kQiMIGSxwd6k4MpCaxkIQ== X-Received: by 2002:a92:c010:0:b0:325:b96e:6709 with SMTP id q16-20020a92c010000000b00325b96e6709mr13067841ild.11.1686255364879; Thu, 08 Jun 2023 13:16:04 -0700 (PDT) Received: from murgatroyd (75-166-136-83.hlrn.qwest.net. [75.166.136.83]) by smtp.gmail.com with ESMTPSA id eq16-20020a0566384e3000b00405f36ed05asm476541jab.55.2023.06.08.13.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 13:16:04 -0700 (PDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v2 8/9] Implement gdb.execute_mi References: <20230404-dap-loaded-sources-v2-0-93f229095e03@adacore.com> <20230404-dap-loaded-sources-v2-8-93f229095e03@adacore.com> <3f4fa15a-29f0-f1bb-f824-fbe9d344c397@simark.ca> X-Attribution: Tom Date: Thu, 08 Jun 2023 14:16:03 -0600 In-Reply-To: <3f4fa15a-29f0-f1bb-f824-fbe9d344c397@simark.ca> (Simon Marchi's message of "Mon, 29 May 2023 11:54:17 -0400") Message-ID: <87h6rhaews.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: Simon> There are not a lot of commands getting the current interpreter, Simon> but -gdb-exit is one of them. I looked at this a little bit today. I found 4 places doing this: struct mi_interp *mi = (struct mi_interp *) command_interp (); A couple of these are, IMO, latent bugs. For -gdb-exit in particular, it seems completely fine for me to simply not print anything if the command interpreter is not an MI interpreter. After all, gdb is about to exit, and the Python call isn't returning anyway. Some other spots should probably use gdb::checked_static_cast to find bugs earlier. Simon> The other places that get the current interpreter are mostly in the Simon> observers that output notifications. So that got me wondering, what Simon> should we do with any MI notification happening during the execution of Simon> the MI command? I still haven't looked into this part. Tom