From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12894 invoked by alias); 25 Sep 2009 19:39:44 -0000 Received: (qmail 12884 invoked by uid 22791); 25 Sep 2009 19:39:41 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from e24smtp01.br.ibm.com (HELO e24smtp01.br.ibm.com) (32.104.18.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Sep 2009 19:39:36 +0000 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by e24smtp01.br.ibm.com (8.14.3/8.13.1) with ESMTP id n8PJhi5b026200 for ; Fri, 25 Sep 2009 16:43:44 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8PJdYdd3698802 for ; Fri, 25 Sep 2009 16:39:34 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8PJdX5h020512 for ; Fri, 25 Sep 2009 16:39:33 -0300 Received: from miki.localnet (dyn531417.br.ibm.com [9.18.235.154]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n8PJdXGV020506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Sep 2009 16:39:33 -0300 From: =?iso-8859-1?q?S=E9rgio_Durigan_J=FAnior?= To: tromey@redhat.com Subject: Re: [RFC] Wording of "catch syscall " warning Date: Fri, 25 Sep 2009 19:39:00 -0000 User-Agent: KMail/1.12.1 (Linux/2.6.30.4; KDE/4.3.1; i686; ; ) Cc: Doug Evans , gdb-patches@sourceware.org References: <20090925003107.87780843AC@ruffy.mtv.corp.google.com> <200909242257.11714.sergiodj@linux.vnet.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200909251639.32714.sergiodj@linux.vnet.ibm.com> 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: 2009-09/txt/msg00817.txt.bz2 On Friday 25 September 2009, Tom Tromey wrote: > >>>>> "S=E9rgio" =3D=3D S=E9rgio Durigan J=FAnior > >>>>> writes: >=20 > S=E9rgio> + return _sysinfo =3D=3D NULL ? 0 : 1; >=20 > I hadn't noticed this in the syscall patches before, but I think > starting a name with "_" is mildly bad. Those names are reserved for > the system. I addressed all the issues. Please, take a look at this patch. Thank you, --=20 S=E9rgio Durigan J=FAnior Linux on Power Toolchain - Software Engineer Linux Technology Center - LTC IBM Brazil diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index 15bfe6f..9ac0947 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -114,7 +114,7 @@ struct syscall_parsing_data =20 /* Structure used to store information about the available syscalls in the system. */ -static const struct syscalls_info *_sysinfo =3D NULL; +static const struct syscalls_info *sysinfo =3D NULL; =20 /* A flag to tell if we already initialized the structure above. */ static int have_initialized_sysinfo =3D 0; @@ -275,10 +275,7 @@ xml_init_syscalls_info (const char *filename) =20 full_file =3D xml_fetch_content_from_file (filename, gdb_datadir); if (full_file =3D=3D NULL) - { - warning (_("Could not open \"%s\""), filename); - return NULL; - } + return NULL; =20 back_to =3D make_cleanup (xfree, full_file); =20 @@ -300,27 +297,23 @@ init_sysinfo (void) /* Did we already try to initialize the structure? */ if (have_initialized_sysinfo) return; -/* if (xml_syscall_file =3D=3D NULL) - internal_error (__FILE__, __LINE__, - _("This architecture has not set the XML syscall file " - "name. This is a bug and should not happen; please " - "report it.")); */ =20 - _sysinfo =3D xml_init_syscalls_info (xml_syscall_file); + sysinfo =3D xml_init_syscalls_info (xml_syscall_file); =20 have_initialized_sysinfo =3D 1; =20 - if (_sysinfo =3D=3D NULL) + if (sysinfo =3D=3D NULL) { if (xml_syscall_file) - /* The initialization failed. Let's show a warning - message to the user (just this time) and leave. */ - warning (_("Could not load the syscall XML file `%s'.\n\ -GDB will not be able to display syscall names."), xml_syscall_file); + warning (_("\ +Could not load the syscall XML file `%s'."), xml_syscall_file); else - /* There's no file to open. Let's warn the user. */ - warning (_("There is no XML file to open.\n\ -GDB will not be able to display syscall names.")); + warning (_("\ +There is no XML file to open.")); + + warning (_("\ +GDB will not be able to display syscall names nor to verify if\n\ +any provided syscall numbers are valid.")); } } =20 @@ -408,7 +401,7 @@ get_syscall_by_number (int syscall_number, init_sysinfo (); =20 s->number =3D syscall_number; - s->name =3D xml_get_syscall_name (_sysinfo, syscall_number); + s->name =3D xml_get_syscall_name (sysinfo, syscall_number); } =20 void @@ -417,7 +410,7 @@ get_syscall_by_name (const char *syscall_name, { init_sysinfo (); =20 - s->number =3D xml_get_syscall_number (_sysinfo, syscall_name); + s->number =3D xml_get_syscall_number (sysinfo, syscall_name); s->name =3D syscall_name; } =20 @@ -426,7 +419,7 @@ get_syscall_names (void) { init_sysinfo (); =20 - return xml_list_of_syscalls (_sysinfo); + return xml_list_of_syscalls (sysinfo); } =20 #endif /* ! HAVE_LIBEXPAT */