From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15369 invoked by alias); 25 Sep 2009 20:15:34 -0000 Received: (qmail 15348 invoked by uid 22791); 25 Sep 2009 20:15:26 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Sep 2009 20:15:20 +0000 Received: from spaceape23.eur.corp.google.com (spaceape23.eur.corp.google.com [172.28.16.75]) by smtp-out.google.com with ESMTP id n8PKFHKJ009226 for ; Fri, 25 Sep 2009 21:15:18 +0100 Received: from ywh8 (ywh8.prod.google.com [10.192.8.8]) by spaceape23.eur.corp.google.com with ESMTP id n8PKFF8M019575 for ; Fri, 25 Sep 2009 13:15:15 -0700 Received: by ywh8 with SMTP id 8so3208474ywh.16 for ; Fri, 25 Sep 2009 13:15:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.173.10 with SMTP id v10mr3126407ybe.230.1253909714730; Fri, 25 Sep 2009 13:15:14 -0700 (PDT) In-Reply-To: <200909251639.32714.sergiodj@linux.vnet.ibm.com> References: <20090925003107.87780843AC@ruffy.mtv.corp.google.com> <200909242257.11714.sergiodj@linux.vnet.ibm.com> <200909251639.32714.sergiodj@linux.vnet.ibm.com> Date: Fri, 25 Sep 2009 20:15:00 -0000 Message-ID: Subject: Re: [RFC] Wording of "catch syscall " warning From: Doug Evans To: =?ISO-8859-1?Q?S=E9rgio_Durigan_J=FAnior?= Cc: tromey@redhat.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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/msg00818.txt.bz2 2009/9/25 S=E9rgio Durigan J=FAnior : > On Friday 25 September 2009, Tom Tromey wrote: >> >>>>> "S=E9rgio" =3D=3D S=E9rgio Durigan J=FAnior >> >>>>> writes: >> >> S=E9rgio> + =A0return _sysinfo =3D=3D NULL ? 0 : 1; >> >> I hadn't noticed this in the syscall patches before, but I think >> starting a name with "_" is mildly bad. =A0Those names are reserved for >> the system. > > I addressed all the issues. =A0Please, take a look at this patch. > > Thank you, > > -- > 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 > > =A0/* Structure used to store information about the available syscalls in > =A0 =A0the system. =A0*/ > -static const struct syscalls_info *_sysinfo =3D NULL; > +static const struct syscalls_info *sysinfo =3D NULL; > > =A0/* A flag to tell if we already initialized the structure above. =A0*/ > =A0static int have_initialized_sysinfo =3D 0; > @@ -275,10 +275,7 @@ xml_init_syscalls_info (const char *filename) > > =A0 full_file =3D xml_fetch_content_from_file (filename, gdb_datadir); > =A0 if (full_file =3D=3D NULL) > - =A0 =A0{ > - =A0 =A0 =A0warning (_("Could not open \"%s\""), filename); > - =A0 =A0 =A0return NULL; > - =A0 =A0} > + =A0 =A0return NULL; > > =A0 back_to =3D make_cleanup (xfree, full_file); > > @@ -300,27 +297,23 @@ init_sysinfo (void) > =A0 /* Did we already try to initialize the structure? =A0*/ > =A0 if (have_initialized_sysinfo) > =A0 =A0 return; > -/* =A0if (xml_syscall_file =3D=3D NULL) > - =A0 =A0internal_error (__FILE__, __LINE__, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_("This architecture has not set= the XML syscall file " > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"name. =A0This is a bug and = should not happen; please " > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"report it.")); */ > > - =A0_sysinfo =3D xml_init_syscalls_info (xml_syscall_file); > + =A0sysinfo =3D xml_init_syscalls_info (xml_syscall_file); > > =A0 have_initialized_sysinfo =3D 1; > > - =A0if (_sysinfo =3D=3D NULL) > + =A0if (sysinfo =3D=3D NULL) > =A0 =A0 { > =A0 =A0 =A0 if (xml_syscall_file) > - =A0 =A0 =A0 =A0/* The initialization failed. =A0Let's show a warning > - =A0 =A0 =A0 =A0 =A0 message to the user (just this time) and leave. =A0= */ > - =A0 =A0 =A0 =A0warning (_("Could not load the syscall XML file `%s'.\n\ > -GDB will not be able to display syscall names."), xml_syscall_file); > + =A0 =A0 =A0 warning (_("\ > +Could not load the syscall XML file `%s'."), xml_syscall_file); > =A0 =A0 =A0 else > - =A0 =A0 =A0 =A0/* There's no file to open. =A0Let's warn the user. =A0*/ > - =A0 =A0 =A0 =A0warning (_("There is no XML file to open.\n\ > -GDB will not be able to display syscall names.")); > + =A0 =A0 =A0 warning (_("\ > +There is no XML file to open.")); > + > + =A0 =A0 =A0warning (_("\ > +GDB will not be able to display syscall names nor to verify if\n\ > +any provided syscall numbers are valid.")); > =A0 =A0 } > =A0} > > @@ -408,7 +401,7 @@ get_syscall_by_number (int syscall_number, > =A0 init_sysinfo (); > > =A0 s->number =3D syscall_number; > - =A0s->name =3D xml_get_syscall_name (_sysinfo, syscall_number); > + =A0s->name =3D xml_get_syscall_name (sysinfo, syscall_number); > =A0} > > =A0void > @@ -417,7 +410,7 @@ get_syscall_by_name (const char *syscall_name, > =A0{ > =A0 init_sysinfo (); > > - =A0s->number =3D xml_get_syscall_number (_sysinfo, syscall_name); > + =A0s->number =3D xml_get_syscall_number (sysinfo, syscall_name); > =A0 s->name =3D syscall_name; > =A0} > > @@ -426,7 +419,7 @@ get_syscall_names (void) > =A0{ > =A0 init_sysinfo (); > > - =A0return xml_list_of_syscalls (_sysinfo); > + =A0return xml_list_of_syscalls (sysinfo); > =A0} > > =A0#endif /* ! HAVE_LIBEXPAT */ > It wasn't clear that this addressed my concerns when !HAVE_LIBEXPAT so I applied the patch and gave it a spin. Two nits: I still see a warning at start-up, and When I do "catch syscall" I still get warning: The number '20' does not represent a known syscall. for every invocation. [Did I misunderstand? Or did we want this warning, which is issued in breakpoint.c, to only happen once if !HAVE_LIBEXPAT.]