From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta33.uswest2.a.cloudfilter.net (omta33.uswest2.a.cloudfilter.net [35.89.44.32]) by sourceware.org (Postfix) with ESMTPS id 338183858426 for ; Fri, 8 Sep 2023 16:53:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 338183858426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-5004a.ext.cloudfilter.net ([10.0.29.221]) by cmsmtp with ESMTP id eeMsqauqhOzKleejHqKZcK; Fri, 08 Sep 2023 16:53:11 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id eejGqO7d4X8GpeejGqoMEN; Fri, 08 Sep 2023 16:53:10 +0000 X-Authority-Analysis: v=2.4 cv=IqsNzZzg c=1 sm=1 tr=0 ts=64fb5176 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=zNV7Rl7Rt7sA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=f0lk4-zMeBeW2DgKxloA:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=EYibpiQO3z9t9lbq87BmtmNxHJDsaRCI+5X6ksk4z6E=; b=MAbEJdcwD/fLPEPM3GHBGKMuHR lnuFxnWUncYTJTB4ILWGWPkwTV5y9i6hKJt+dFNoiulR/eVHAVlz8JDNhqGkMdKlWxi/AvakEdV4P 5CwVoybDI4dpXzFYoUkesIn7R; Received: from 71-211-130-31.hlrn.qwest.net ([71.211.130.31]:33536 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qeejF-00143Q-2z; Fri, 08 Sep 2023 10:53:09 -0600 From: Tom Tromey To: Jan Vrany via Gdb Cc: Jan Vrany Subject: Re: MI and modifying register value References: <459b4b9d5f83a6b03b66486a45f5c4e4daa0b5e7.camel@vrany.io> X-Attribution: Tom Date: Fri, 08 Sep 2023 10:53:09 -0600 In-Reply-To: <459b4b9d5f83a6b03b66486a45f5c4e4daa0b5e7.camel@vrany.io> (Jan Vrany via Gdb's message of "Mon, 04 Sep 2023 21:41:18 +0000") Message-ID: <87msxwli8a.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.130.31 X-Source-L: No X-Exim-ID: 1qeejF-00143Q-2z X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-130-31.hlrn.qwest.net (murgatroyd) [71.211.130.31]:33536 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOTJrIS263nZOWj8S4csU/xm1FdMOGlZCz4opxz2txWndQA571DhxveNdByhbulu/cYbYeyBBiA5z6AjxeNxWYFBhefWqXO9LAapr+/wSNf4DpFO+8Nl IFHotoEtt2/BxMQ09W2rusMWLvBPW4q7HuC5G4Lid6mUW8H97lrzmPDsmY/5jGAd1nflsvTv0NsNSQ== X-Spam-Status: No, score=-3018.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP 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: >>>>> "Jan" =3D=3D Jan Vrany via Gdb writes: Jan> 1) There's an MI command to set register value: -data-write-register-v= alues Jan> This command is not documented and looking at the code, seems to be= somewhat Jan> half-implemented - does not use parameter its comment ment= ions and Jan> only works for frame 0 (but using --frame 1 does not result in an e= rror, Jan> it just silently changes value in frame 0).=20 Jan> Is this command some leftover that should not be used (but kept for= some Jan> old clients)? Or is it something to fix?=20 It's very old and seems to have landed without tests or documentation. I think the addition of 'format' here must be some kind of copy-paste bug. I can't imagine how it would be useful. However, in the spirit of API conservatism I think it should just be left untouched -- we can just document that it's a mistake and clients can send whatever they like for this argument. Fixing the frame bug seems completely fine to me. Jan> 2) Another way to change register value is CLI command `set r4 =3D 0x4= `. There's Jan> no mechanism the MI client gets notified about the change - there's= no =3Dregister-changed Jan> async event.=C2=A0 Surely it must be "set $r4 =3D 0x4" -- the "$" should be needed I think. Jan> Is this by purpose? I'd expect some kind of notification, just like= there's =3Dmemory-changed Jan> event. Also, in Python API, there's memory_ckanged event which get = triggered when Jan> using `set` to modify register.=20 There's the weird "-data-list-changed-registers" command. It doesn't really documented "changed since what", but it seems to be "since last time this was called". There's a static local variable in the implementation :-( I do see there is a "register_changed" observable, so implementing the notification seems relatively easy. This observable seems to only track changes made by the user, though. Tom