From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15960 invoked by alias); 7 Nov 2008 18:24:50 -0000 Received: (qmail 15926 invoked by uid 22791); 7 Nov 2008 18:24:49 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Nov 2008 18:24:13 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mA7IO8ER018607; Fri, 7 Nov 2008 13:24:08 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mA7IO7nZ031689; Fri, 7 Nov 2008 13:24:07 -0500 Received: from opsy.redhat.com (vpn-12-123.rdu.redhat.com [10.11.12.123]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mA7IO601016136; Fri, 7 Nov 2008 13:24:07 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id E2FEE88803F; Fri, 7 Nov 2008 11:24:05 -0700 (MST) To: =?utf-8?Q?S=C3=A9rgio?= Durigan =?utf-8?Q?J=C3=BAnior?= Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/4] 'catch syscall' feature -- XML support part References: <1225773086.24532.55.camel@miki> <1226029557.32321.104.camel@miki> From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Fri, 07 Nov 2008 18:24:00 -0000 In-Reply-To: <1226029557.32321.104.camel@miki> (=?utf-8?Q?=22S=C3=A9rgio?= Durigan =?utf-8?Q?J=C3=BAnior=22's?= message of "Fri\, 07 Nov 2008 01\:45\:57 -0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-11/txt/msg00135.txt.bz2 >>>>> "S=C3=A9rgio" =3D=3D S=C3=A9rgio Durigan J=C3=BAnior writes: Tom> This will make an entry with an empty name given the above XML Tom> snippet. But that doesn't seem helpful... if this triggers, won't it Tom> print as an unnamed syscall? It seems to me that it would be Tom> preferable to skip nameless ones and just report them numerically, if Tom> they occur. S=C3=A9rgio> I'm sorry, but I think I didn't understand completely what you S=C3=A9rgio> suggested. You mean that I should set the syscall name to NULL= when S=C3=A9rgio> there's no name for it in the XML file? I think nameless syscalls should simply not be in the table at all. S=C3=A9rgio> + if (gdb_xml_parse (parser, document) =3D=3D 0) S=C3=A9rgio> + { S=C3=A9rgio> + /* Parsed successfully. */ S=C3=A9rgio> + discard_cleanups (result_cleanup); S=C3=A9rgio> + do_cleanups (back_to); S=C3=A9rgio> + return data.sysinfo; S=C3=A9rgio> + } S=C3=A9rgio> + else S=C3=A9rgio> + { S=C3=A9rgio> + warning (_("Could not load XML syscalls info; ignoring"= )); S=C3=A9rgio> + do_cleanups (back_to); S=C3=A9rgio> + return NULL; Tom>=20 Tom> ... you can either just do_ or discard_ result_cleanup instead. S=C3=A9rgio> I'm sorry, instead of what? do_cleanups? :-) I think instead of the above you can simply: if (...) ... discard_cleanups (result_cleanup); else ... do_cleanups (result_cleanup); Tom