Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: "Sérgio Durigan Júnior" <sergiodj@linux.vnet.ibm.com>
Cc: tromey@redhat.com, gdb-patches@sourceware.org
Subject: Re: [RFC] Wording of "catch syscall <number>" warning
Date: Fri, 25 Sep 2009 20:15:00 -0000	[thread overview]
Message-ID: <e394668d0909251315y7cee291hbc1b4798ab5a5f35@mail.gmail.com> (raw)
In-Reply-To: <200909251639.32714.sergiodj@linux.vnet.ibm.com>

2009/9/25 Sérgio Durigan Júnior <sergiodj@linux.vnet.ibm.com>:
> On Friday 25 September 2009, Tom Tromey wrote:
>> >>>>> "Sérgio" == Sérgio Durigan Júnior <sergiodj@linux.vnet.ibm.com>
>> >>>>> writes:
>>
>> Sérgio> +  return _sysinfo == NULL ? 0 : 1;
>>
>> 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,
>
> --
> Sérgio Durigan Júnior
> 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
>
>  /* Structure used to store information about the available syscalls in
>    the system.  */
> -static const struct syscalls_info *_sysinfo = NULL;
> +static const struct syscalls_info *sysinfo = NULL;
>
>  /* A flag to tell if we already initialized the structure above.  */
>  static int have_initialized_sysinfo = 0;
> @@ -275,10 +275,7 @@ xml_init_syscalls_info (const char *filename)
>
>   full_file = xml_fetch_content_from_file (filename, gdb_datadir);
>   if (full_file == NULL)
> -    {
> -      warning (_("Could not open \"%s\""), filename);
> -      return NULL;
> -    }
> +    return NULL;
>
>   back_to = make_cleanup (xfree, full_file);
>
> @@ -300,27 +297,23 @@ init_sysinfo (void)
>   /* Did we already try to initialize the structure?  */
>   if (have_initialized_sysinfo)
>     return;
> -/*  if (xml_syscall_file == 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.")); */
>
> -  _sysinfo = xml_init_syscalls_info (xml_syscall_file);
> +  sysinfo = xml_init_syscalls_info (xml_syscall_file);
>
>   have_initialized_sysinfo = 1;
>
> -  if (_sysinfo == NULL)
> +  if (sysinfo == 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."));
>     }
>  }
>
> @@ -408,7 +401,7 @@ get_syscall_by_number (int syscall_number,
>   init_sysinfo ();
>
>   s->number = syscall_number;
> -  s->name = xml_get_syscall_name (_sysinfo, syscall_number);
> +  s->name = xml_get_syscall_name (sysinfo, syscall_number);
>  }
>
>  void
> @@ -417,7 +410,7 @@ get_syscall_by_name (const char *syscall_name,
>  {
>   init_sysinfo ();
>
> -  s->number = xml_get_syscall_number (_sysinfo, syscall_name);
> +  s->number = xml_get_syscall_number (sysinfo, syscall_name);
>   s->name = syscall_name;
>  }
>
> @@ -426,7 +419,7 @@ get_syscall_names (void)
>  {
>   init_sysinfo ();
>
> -  return xml_list_of_syscalls (_sysinfo);
> +  return xml_list_of_syscalls (sysinfo);
>  }
>
>  #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.]


  reply	other threads:[~2009-09-25 20:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25  0:31 Doug Evans
2009-09-25  1:49 ` Joel Brobecker
2009-09-25  2:02   ` Sérgio Durigan Júnior
2009-09-25  2:20     ` Joel Brobecker
2009-09-25  2:38       ` Sérgio Durigan Júnior
2009-09-25  5:35         ` Doug Evans
2009-09-25 15:30           ` Joel Brobecker
2009-09-25 15:45           ` Tom Tromey
2009-09-25 16:07             ` Joel Brobecker
2009-09-25 16:50               ` Sérgio Durigan Júnior
2009-09-25  1:57 ` Sérgio Durigan Júnior
2009-09-25 15:45   ` Tom Tromey
2009-09-25 16:50     ` Sérgio Durigan Júnior
2009-09-25 19:39     ` Sérgio Durigan Júnior
2009-09-25 20:15       ` Doug Evans [this message]
2009-09-26 19:18         ` Sérgio Durigan Júnior
2009-09-26 23:34         ` Sérgio Durigan Júnior
2009-09-28  5:09           ` Doug Evans
2009-10-03  3:19             ` Sérgio Durigan Júnior
2009-10-31  6:02               ` Sérgio Durigan Júnior
2009-09-25 23:00       ` Sérgio Durigan Júnior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e394668d0909251315y7cee291hbc1b4798ab5a5f35@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@linux.vnet.ibm.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox