From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30647 invoked by alias); 31 Mar 2008 00:46:09 -0000 Received: (qmail 30639 invoked by uid 22791); 31 Mar 2008 00:46:08 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 31 Mar 2008 00:45:33 +0000 Received: from kahikatea.snap.net.nz (68.62.255.123.dynamic.snap.net.nz [123.255.62.68]) by viper.snap.net.nz (Postfix) with ESMTP id 067EF3DA094; Mon, 31 Mar 2008 13:45:23 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 27FC78FC6D; Mon, 31 Mar 2008 12:45:19 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18416.13342.147430.549879@kahikatea.snap.net.nz> Date: Mon, 31 Mar 2008 00:46:00 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: cleanup mi error message handling In-Reply-To: <200803301005.39285.ghost@cs.msu.su> References: <200803241830.11759.pedro@codesourcery.com> <18415.8302.588187.39111@kahikatea.snap.net.nz> <200803301005.39285.ghost@cs.msu.su> X-Mailer: VM 7.19 under Emacs 22.1.92.3 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: 2008-03/txt/msg00491.txt.bz2 > The only thing from you I can find is: > > At other times duplicated error messages are desirable, e.g., > > -exec-continue > ^running > (gdb) > &"The program is not being run.\n" > ^error,msg="The program is not being run." > > because the first goes to the console for the user to see, the second to > the frontend to be handled as appropriate. > > You still did not say why showing the error message is console is desirable. > If -exec-continue itself is now show in the console, the error message > makes no sense. If -exec-continue is shown, then the error message is not > necessary. Where the flaw in this logic. I can't understand these sentences. The command -exec-continue won't appear in the console but "The program is not being run." will. These `errors' and other similar ones like "No stack." are reported through error () and are normal Gdb output for the user to see. Currently the console can display such messages by reading LOG-STREAM-OUTPUT. Other errors like: (gdb) -interpreter-exec ^error,msg="mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command" (gdb) would be due to a frontend error, so I think it would be probably be best to display them elsewhare, e.g., status bar. The only way for the frontend to distinguish between the two types of error is if the Gdb developer uses the appropriate mechanism, i.e. error () or mi_error_message in each case. I wouldn't make any changes until a real problem is reported (not just Pedro tidying things up). If a change has to be made I would suggest the one below. However this would mean going through all the errors reported in MI to work out which ones need mi_error_message but currently use error (), e.g., "mi_cmd_stack_list_locals: Usage: PRINT_VALUES". > > > > > And if we enable logging of MI commands, user can see the > > > information even if nothing goes to "&" channel. > > > > And nothing goes to the console. Same old story. > > Sorry, I don't understand what is "old story" and why nothing goes to > console. Right from when I started and there was an attempt to remove annotations, it feels like the console has been under threat. -- Nick http://www.inet.net.nz/~nickrob *** mi-main.c 31 Mar 2008 12:08:10 +1200 1.110 --- mi-main.c 31 Mar 2008 12:16:01 +1200 *************** mi_execute_command (char *cmd, int from_ *** 1260,1278 **** mi_parse_free (command); return; } ! if (result.reason < 0) ! { ! /* The command execution failed and error() was called ! somewhere. */ ! fputs_unfiltered (command->token, raw_stdout); ! fputs_unfiltered ("^error,msg=\"", raw_stdout); ! if (result.message == NULL) ! fputs_unfiltered ("unknown error", raw_stdout); ! else ! fputstr_unfiltered (result.message, '"', raw_stdout); ! fputs_unfiltered ("\"\n", raw_stdout); ! mi_out_rewind (uiout); ! } mi_parse_free (command); } --- 1260,1266 ---- mi_parse_free (command); return; } ! mi_parse_free (command); }