From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20858 invoked by alias); 12 Sep 2009 02:57:45 -0000 Received: (qmail 20849 invoked by uid 22791); 12 Sep 2009 02:57:44 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f180.google.com (HELO mail-px0-f180.google.com) (209.85.216.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Sep 2009 02:57:39 +0000 Received: by pxi10 with SMTP id 10so1363406pxi.24 for ; Fri, 11 Sep 2009 19:57:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.21.30 with SMTP id y30mr315429wfi.229.1252724258099; Fri, 11 Sep 2009 19:57:38 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Sat, 12 Sep 2009 02:57:00 -0000 Message-ID: Subject: Re: set record query To: Marc Khouzam Cc: "tromey@redhat.com" , "gdb-patches@sourceware.org" , Michael Snyder Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2009-09/txt/msg00359.txt.bz2 If you don't mind. I suggest you discussion "Eclipse handle query" in a special thread. Let's talk about my idea about this patch. I think give a switch to close the query in the prec is not bad. Even if we don't use Eclipse, we still need close query sometime. But someone want this swich always "yes", someone want always "no". So I suggest each query have a special "switch" to control it. For example: set record query off set record changememory yes set record changereg yes If query is on, this yes or no choice yquery or nquery. If query is off, this yes or no can be the answer. What do you think about it? Thanks, Hui On Sat, Sep 12, 2009 at 09:08, Marc Khouzam wro= te: >> -----Original Message----- >> From: Tom Tromey [mailto:tromey@redhat.com] >> Sent: September-11-09 6:07 PM >> To: Marc Khouzam >> Cc: 'gdb-patches@sourceware.org' >> Subject: Re: set record query >> >> >>>>> "Marc" =3D=3D Marc Khouzam writes: >> >> Marc> here is a patch to allow to enable/disable the queries >> Marc> used in Record. =A0It is relevant to: >> Marc> http://sourceware.org/ml/gdb/2009-09/msg00165.html >> Marc> What do you think? >> >> It seems like a strange approach to me. > > I was hoping for something more generic for queries, but in the few > email exchanges, things kept coming back to such a specific new > Record command. > >> I don't think I know the whole background here. =A0Is this to help users >> who enter commands at a console? =A0Or MI? =A0Or CLI commands sent by >> Eclipse, but not from a user console (that is, in response to some GUI >> control)? > > Sorry, I should have summarized the issue in the mail. =A0Here goes. > > When Eclipse is interacting with GDB, there is a single "channel of > communication" which is used for everything (MI, CLI when no MI equivalen= t, > and Eclipse console). =A0This channel triggers the GDB code paths > that are "!input_from_terminal_p ()" and this makes every query > be automatically answered with the default answer. > > This was not a problem before because there was only a single > use of nquery() and it was never triggered by Eclipse > (it was for pending breakpoints). > With PRecord though, there are new uses of nquery(), and these, from Ecli= pse, > keep being answer 'N' automatically. > > Only one case is actually a problem right now: > it is when changing memory (or registers) while replaying execution; in t= his > case there is an nquery(), and since it is automatically answered, I just > cannot set memory during an replay. =A0Being able to change memory during > replay is one of the cool features of PRecord, and that is why I'm trying > really hard to get this to work for 7.0. > BTW, to attempt to set memory, we use -var-assign so I cannot use the > "server" prefix. > >> For MI, it seems like there should be arguments to the >> internal function >> and then the MI commands should disable querying that way. >> That is, you >> don't need a new user-visible setting for this. > > Disabling queries based on MI is something that was brought up. > The idea was to have queries check if the interpreter was MI and in > this case, answer 'Y' to any query. > I like this because it is more future-proof. > Is that what you are suggesting too? > >> For the CLI-commands-sent-by-Eclipse case, it seems like you could use >> the "server" prefix. > > This may be useful for other cases, but in the current case (-var-assign) > it does not work. > >> For the console case... it seems to me that queries are just >> a necessary part of that. > > It would be nicer to have queries in this case but not only does it > not work because we are in the case !input_from_terminal_p (), but having > a query would block the "communication channel" waiting for user input, > which would somewhat lock-up the Eclipse GUI. > > So, to summarize the summary, I need a way to get GDB to answer 'Y' for e= very > query, even nquery(). =A0And right now, the only time this is needed is f= or PRecord. > > Thanks for any more guidance. > > Marc >