From patchwork Wed Mar 19 18:47:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 171 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (caibbdcaaahb.dreamhost.com [208.113.200.71]) by wilcox.dreamhost.com (Postfix) with ESMTP id 8909036008B for ; Wed, 19 Mar 2014 11:47:57 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id 35C0DC7885B; Wed, 19 Mar 2014 11:47:57 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 024E1C7888C for ; Wed, 19 Mar 2014 11:47:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=mzsPIT0OdfDIUzpRm/Oe6JiMNqH5Q mv/Xu1BIa0fs7lEEXbl4eXCaSe6vfgYzAuqShtC7W3JSG3oNmBFqIRoe8SO8PGfo 0cpQyn5Rt1a2cCuPCtg7fOcvxC2x558zo3/quUe1qh76bpV/ZYq0bsDJugYlmQp2 WighLA3e3zlEDw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=T8EKvpH6DBssoRpzTILHNh/5SmY=; b=BX0 RLLzfSEtB1i47Qcrr3V7HCscQZL6I8A8e1NZu+gAbSOslm8xBu/MWEMNOOir+WA5 UTwDNl3Nds+Dd0rUq7aJSmaqMrhZDYcwbsNZ/Cm+YmZv9+xz0elKX3i/VROwgHm8 C97hpygi20mdfkowDnAsXhaz+2eCNj1WAmk2YzpM= Received: (qmail 17336 invoked by alias); 19 Mar 2014 18:47:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17327 invoked by uid 89); 19 Mar 2014 18:47:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Mar 2014 18:47:53 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WQLWn-0000U7-Vs from Maciej_Rozycki@mentor.com for gdb-patches@sourceware.org; Wed, 19 Mar 2014 11:47:50 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 19 Mar 2014 11:47:50 -0700 Received: from [172.30.64.80] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 19 Mar 2014 18:47:47 +0000 Date: Wed, 19 Mar 2014 18:47:38 +0000 From: "Maciej W. Rozycki" To: Subject: [PATCH] Avoid using the ISO C99 `z' formatted output modifier Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 X-DH-Original-To: gdb@patchwork.siddhesh.in Hi, This fixes a call in mi_memory_changed that makes use of the ISO C99 `z' formatted output modifier. We still require ISO C90 conformance. This update removes a failure on the i686-mingw32 host (tested with the powerpc-eabi target): (gdb) PASS: gdb.mi/mi-memory-changed.exp: continue to callee4 Expecting: ^(set var C = 4[ ]+)?(.*=memory-changed,thread-group="i[0-9]+".addr="0x[0-9A-Fa-f]+",len="0x[0-9A-Fa-f]+".*\^done[ ]+[(]gdb[)] [ ]*) set var C = 4 &"set var C = 4\n" =memory-changed,thread-group="i1",addr="0x17ffff28",len="0xzx" ^done (gdb) FAIL: gdb.mi/mi-memory-changed.exp: set var C = 4 With the change applied the log is as follows: (gdb) PASS: gdb.mi/mi-memory-changed.exp: continue to callee4 Expecting: ^(set var C = 4[ ]+)?(.*=memory-changed,thread-group="i[0-9]+".addr="0x[0-9A-Fa-f]+",len="0x[0-9A-Fa-f]+".*\^done[ ]+[(]gdb[)] [ ]*) set var C = 4 &"set var C = 4\n" =memory-changed,thread-group="i1",addr="0x17ffff28",len="0x4" ^done (gdb) PASS: gdb.mi/mi-memory-changed.exp: set var C = 4 No change in output on the i686-linux-gnu host. OK to apply? 2014-03-19 Maciej W. Rozycki gdb/ * mi/mi-interp.c (mi_memory_changed): Avoid using the ISO C99 `z' formatted output modifier. Maciej gdb-mi-interp-size-t-printf.diff Index: gdb-fsf-trunk-quilt/gdb/mi/mi-interp.c =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/mi/mi-interp.c 2014-01-14 22:02:56.000000000 +0000 +++ gdb-fsf-trunk-quilt/gdb/mi/mi-interp.c 2014-03-19 13:25:57.018399978 +0000 @@ -854,7 +854,7 @@ mi_memory_changed (struct inferior *infe ui_out_field_fmt (mi_uiout, "thread-group", "i%d", inferior->num); ui_out_field_core_addr (mi_uiout, "addr", target_gdbarch (), memaddr); - ui_out_field_fmt (mi_uiout, "len", "0x%zx", len); + ui_out_field_fmt (mi_uiout, "len", "%s", hex_string (len)); /* Append 'type=code' into notification if MEMADDR falls in the range of sections contain code. */