From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21428 invoked by alias); 16 May 2014 15:42:56 -0000 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 Received: (qmail 21409 invoked by uid 89); 16 May 2014 15:42:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 May 2014 15:42:54 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4GFgoDE026061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 May 2014 11:42:50 -0400 Received: from barimba (ovpn-113-182.phx2.redhat.com [10.3.113.182]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4GFgnU3014128 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 16 May 2014 11:42:50 -0400 From: Tom Tromey To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] PR mi/15806: Fix quoting of async events References: <1398568091-21253-1-git-send-email-simon.marchi@ericsson.com> Date: Fri, 16 May 2014 15:42:00 -0000 In-Reply-To: <1398568091-21253-1-git-send-email-simon.marchi@ericsson.com> (Simon Marchi's message of "Sat, 26 Apr 2014 23:08:11 -0400") Message-ID: <878uq17mrq.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-05/txt/msg00297.txt.bz2 >>>>> "Simon" == Simon Marchi writes: Simon> The quoting in whatever goes in the event_channel of MI is little Simon> bit broken. Link for the lazy: Simon> https://sourceware.org/bugzilla/show_bug.cgi?id=15806 Thanks for looking at this. A long time ago I wrote a somewhat similar patch, but I don't think I noticed some of the issues you dug up. Mine was here, I don't recall why it didn't go in: https://www.sourceware.org/ml/gdb-patches/2011-01/msg00518.html Simon> In retrospect, there is no way escaping can be done reliably in Simon> mi_console_raw_packet for data that is already formatted, such as Simon> event_channel. At this point, there is no way to differentiate Simon> quotes that delimit field values from those that should be Simon> escaped. In the case of other MI consoles, it is ok since Simon> mi_console_raw_packet receives one big string that should be Simon> quoted and escaped as a whole. Simon> So, first part of the fix: for the MI channels that specify no Simon> quoting character, no escaping at all should be done in Simon> mi_console_raw_packet (that's the change in printchar, thanks to Simon> Yuanhui Zhang for this). Seems reasonable. Did you check the other callers of printchar, even indirect ones? I did a spot check and didn't see any issues, but it would be reassuring if you could look. Simon> 2014-04-26 Simon Marchi Simon> PR mi/15806 Simon> * utils.c (printchar): Don't escape at all if quoter is NUL. Simon> * mi/mi-interp.c (mi_solib_loaded): Use ui_out_field_* functions to Simon> generate the output. Simon> (mi_solib_unloaded): Same. Simon> 2014-04-26 Simon Marchi Simon> * gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Fix Simon> erroneous dprintf expected input. This is ok. Before putting it in could you, if needed, look into the printchar thing and then reply? Thank you. Tom