From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25527 invoked by alias); 8 Aug 2005 20:34:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25503 invoked by uid 22791); 8 Aug 2005 20:34:51 -0000 Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 08 Aug 2005 20:34:51 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-88-205.inter.net.il [80.230.88.205]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id CBL30350 (AUTH halo1); Mon, 8 Aug 2005 23:34:46 +0300 (IDT) Date: Mon, 08 Aug 2005 21:00:00 -0000 Message-Id: From: Eli Zaretskii To: Nick Roberts CC: gdb-patches@sources.redhat.com In-reply-to: <17142.56731.941946.838268@farnswood.snap.net.nz> (message from Nick Roberts on Mon, 8 Aug 2005 16:20:43 +1200) Subject: Re: RFC: MI output during program execution Reply-to: Eli Zaretskii References: <17142.56731.941946.838268@farnswood.snap.net.nz> X-SW-Source: 2005-08/txt/msg00092.txt.bz2 > From: Nick Roberts > Date: Mon, 8 Aug 2005 16:20:43 +1200 > > --- 241,288 ---- > and then set it back to 0 when we are done. */ > sync_execution = 1; > { > ! struct gdb_exception e; > ! int flag = 0; > ! > ! if (strcmp (argv[0], "console") == 0) > ! /* Stick with MI for commands which run the inferior. */ > ! { > ! struct cmd_list_element *c; > ! extern struct cmd_list_element *cmdlist; > ! char *token, *cp; > ! > ! flag = 1; > ! cp = xstrdup (argv[i]); > ! c = lookup_cmd (&cp, cmdlist, "", 0, 0); > ! if (strcmp (c->name, "run") == 0) > ! mi_cmd_exec_run (cp, 0); > ! else if (strcmp (c->name, "next") == 0) > ! mi_cmd_exec_next (cp, 0); > ! else if (strcmp (c->name, "nexti") == 0) > ! mi_cmd_exec_next_instruction (cp, 0); > ! else if (strcmp (c->name, "step") == 0) > ! mi_cmd_exec_step (cp, 0); > ! else if (strcmp (c->name, "stepi") == 0) > ! mi_cmd_exec_step_instruction (cp, 0); > ! else if (strcmp (c->name, "finish") == 0) > ! mi_cmd_exec_finish (cp, 0); > ! else if (strcmp (c->name, "until") == 0) > ! mi_cmd_exec_until (cp, 0); > ! else if (strcmp (c->name, "return") == 0) > ! mi_cmd_exec_return (cp, 0); > ! else > ! flag = 0; I'm a bit nervous about this literal testing of certain commands: why not allow _any_ CLI commands to be supported in this way? I understand that you were trying to mention every command that runs the inferior, but the implication is that we will need to remember to add to this list any new command that has similar effects. That sounds like a PITA; could a more general solution be devised? But I'm afraid that I'm somehow missing something, so could you please elaborate on the design of the solution you propose?