From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7975 invoked by alias); 26 Jul 2012 08:55:00 -0000 Received: (qmail 7965 invoked by uid 22791); 26 Jul 2012 08:54:59 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jul 2012 08:54:41 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SuJqB-0006Dg-Ce from Yao_Qi@mentor.com ; Thu, 26 Jul 2012 01:54:39 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 26 Jul 2012 01:54:39 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Thu, 26 Jul 2012 01:54:37 -0700 From: Yao Qi To: CC: Tom Tromey Subject: Re: [PATCH 1/6] new observer command_option_changed. Date: Thu, 26 Jul 2012 08:55:00 -0000 Message-ID: <3014587.ycr7yI3D0I@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <87lii7lxno.fsf@fleche.redhat.com> References: <1343146252-22558-1-git-send-email-yao@codesourcery.com> <1343146252-22558-2-git-send-email-yao@codesourcery.com> <87lii7lxno.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00607.txt.bz2 On Wednesday, July 25, 2012 08:31:55 AM Tom Tromey wrote: > Yao> + if (c->notify_observer_p) > Yao> + observer_notify_command_option_changed (c->name, arg); >=20 > Last night I realized that this does the wrong thing for multi-word > parameters. E.g., for "set print elements", the MI client will just see > "elements". Right, we are unable to get the previous command instance "print" in comman= d=20 instance "elements". So we have to move=20 'observer_notify_command_option_changed' out of do_setshow_command to its=20 caller, top.c:execute_command, where the full command option and value is=20 available. Then, we can change 'do_setshow_command' to return a boolean va= lue=20 indicating option is changed or not, and call=20 observer_notify_command_option_changed if do_setshow_command returns true. It works fine for me now. I'll post a patch. --=20 Yao (=E9=BD=90=E5=B0=A7)