From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7639 invoked by alias); 22 Jun 2005 19:19:50 -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 7612 invoked by uid 22791); 22 Jun 2005 19:19:41 -0000 Received: from mail-out4.apple.com (HELO mail-out4.apple.com) (17.254.13.23) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 22 Jun 2005 19:19:41 +0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id j5MJJdHH029861 for ; Wed, 22 Jun 2005 12:19:39 -0700 (PDT) Received: from relay3.apple.com (relay3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Wed, 22 Jun 2005 12:19:39 -0700 Received: from [17.201.22.21] (moleja.apple.com [17.201.22.21]) by relay3.apple.com (8.12.11/8.12.11) with ESMTP id j5MJJcJc021119; Wed, 22 Jun 2005 12:19:38 -0700 (PDT) In-Reply-To: <17081.18071.112390.809523@farnswood.snap.net.nz> References: <17075.57612.684597.392526@farnswood.snap.net.nz> <20050618155742.GB3663@nevyn.them.org> <17076.42233.730605.834264@farnswood.snap.net.nz> <20050618232032.GA28368@nevyn.them.org> <17076.59646.873454.551250@farnswood.snap.net.nz> <20050619145612.GA8219@nevyn.them.org> <17077.61587.164352.664225@farnswood.snap.net.nz> <17078.19977.660644.9978@farnswood.snap.net.nz> <20050620135108.GA29453@nevyn.them.org> <17079.14386.484824.134375@farnswood.snap.net.nz> <17079.57494.321274.96102@farnswood.snap.net.nz> <17080.35377.519988.619664@farnswood.snap.net.nz> <17081.18071.112390.809523@farnswood.snap.net.nz> Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4264116E-8CFC-4D56-8560-A0D471D8761C@apple.com> Cc: Eli Zaretskii , gdb-patches@sources.redhat.com Content-Transfer-Encoding: 7bit From: Jason Molenda Subject: Re: [PATCH] MI error messages Date: Wed, 22 Jun 2005 19:19:00 -0000 To: Nick Roberts X-SW-Source: 2005-06/txt/msg00353.txt.bz2 Hi Nick, This patch is changing two things. You're not using error () when there is an error, and you're changing the error message texsts. Why are you avoiding error()? It's use throughout gdb is established; there are people who like this style of error handling and people who don't, but consistency is valuable and we're using error(). I'm not clear on why you're patching it out of mi-cmd- var.c. Is your goal to have the error message output as just ^error w/o the console-quoted error text? Using your mi_error will result in some error messages (i.e. from the rest of gdb) going through error () and some other error messages (from the mi/ sub directory) using mi_error(), so the front end will have both. Second, the error messages are being changed from e.g. "mi_cmd_var_create: Usage: NAME FRAME EXPRESSION." to "-var-create NAME FRAME EXPRESSION." Why is this better? Neither one means anything to an end user -- they're just strings for programmers to grep for in the gdb sources, and to disambiguate the same error message from different mi commands. Some of the error message changes are good improvements (e.g. adding the symbol that was being var-create'd in "mi_cmd_var_create: unable to create variable object." but you dropped the mi command name, either function or MI command, entirely in that case), but there are a lot of changes in there. (I didn't mention the third change, which is to flag mi command usage error separately, but you can indicate that in the error text already so I didn't see the compelling reason for that change either...) We changed error () here at Apple so it is only printed as an MI ^error msg; our error_stream() reads /* Copy the stream into the GDB_LASTERR buffer. */ ui_file_rewind (gdb_lasterr); ui_file_put (stream, do_write, gdb_lasterr); /* Write the message plus any error_pre_print to gdb_stderr. Don't do it for mi like interpreters, however, since the will get the error from ui_file_rewind. */ if (!ui_out_is_mi_like_p (uiout)) { target_terminal_ours (); wrap_here (""); /* Force out any buffered output */ gdb_flush (gdb_stdout); annotate_error_begin (); if (error_pre_print) fputs_filtered (error_pre_print, gdb_stderr); ui_file_put (stream, do_write, gdb_stderr); fprintf_filtered (gdb_stderr, "\n"); } Jason PS- If you add "-p" to your $HOME/.cvsrc, e.g. diff -up it will make the diffs a tiny bit easier to read. -p makes diff try to figure out the function name and include it in the diff so people can easily tell which function the change is against.