Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Samuel Bronson <naesten@gmail.com>
Cc: gdb-patches@sourceware.org, Doug Evans <dje@google.com>
Subject: Re: [PATCH v2] ARM Linux support for `catch syscall'
Date: Wed, 14 Aug 2013 19:29:00 -0000	[thread overview]
Message-ID: <m3eh9wrrzs.fsf@redhat.com> (raw)
In-Reply-To: <E1V9fPE-00060l-WC@hydrogen> (Samuel Bronson's message of "Wed,	31 Jul 2013 20:47:23 +0000")

Hi Samuel,

Thanks for the patch.  A few comments.

On Wednesday, July 31 2013, Samuel Bronson wrote:

> This time, it passes all the tests and comes with a nearly complete
> XML file (plus a script that can nearly regenerate the XML file).

So the XML file is not complete?  What's missing?  IMO it should
certainly be complete, even if the script can't generate it entirely (in
which case it should be hand editted).

> diff --git a/gdb/syscalls/arm-linux.py b/gdb/syscalls/arm-linux.py
> new file mode 100755
> index 0000000..0814dd4
> --- /dev/null
> +++ b/gdb/syscalls/arm-linux.py
> @@ -0,0 +1,60 @@
> +# Copyright (C) 2013 Free Software Foundation, Inc.
> +
> +# Copying and distribution of this file, with or without modification,
> +# are permitted in any medium without royalty provided the copyright
> +# notice and this notice are preserved.  This file is offered as-is,
> +# without any warranty.
> +
> +import sys
> +import re
> +import time
> +
> +infname = sys.argv[1]
> +inf = file(infname)
> +
> +print("""\
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2009-%s Free Software Foundation, Inc.

The copyright year should be from 2013 to %s, I guess.

> +
> +     Copying and distribution of this file, with or without modification,
> +     are permitted in any medium without royalty provided the copyright
> +     notice and this notice are preserved.  This file is offered as-is,
> +     without any warranty. -->
> +
> +<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
> +
> +<!-- This file was generated using the following file:
> +
> +     %s
> +
> +     The file mentioned above belongs to the Linux Kernel.
> +     Some small hand-edits were made. -->
> +
> +<syscalls_info>""" % (time.strftime("%Y"), infname))
> +
> +def record(name, number, comment=None):
> +    #nm = 'name="%s"' % name
> +    #s = '  <syscall %-30s number="%d"/>' % (nm, number)
> +    s = '  <syscall name="%s" number="%d"/>' % (name, number)
> +    if comment:
> +        s += ' <!-- %s -->' % comment
> +    print(s)
> +
> +for line in inf:
> +    m = re.match(r'^#define __NR_(\w+)\s+\(__NR_SYSCALL_BASE\+\s*(\d+)\)',
> +                 line)
> +    if m:
> +        record(m.group(1), int(m.group(2)))
> +        continue
> +
> +    m = re.match(r'^\s+/\* (\d+) was sys_(\w+) \*/$', line)
> +    if m:
> +        record(m.group(2), int(m.group(1)), 'removed')

I don't get the 'removed' comment.  Looking at
<include/linux/arch/arm/include/uapi/asm/unistd.h>, I don't see the
syscalls marked as "removed" in the XML file below.  Where did they come
from?

> +
> +    m = re.match(r'^#define __ARM_NR_(\w+)\s+\(__ARM_NR_BASE\+\s*(\d+)\)',
> +                 line)
> +    if m:
> +        record('ARM_'+m.group(1), 0x0f0000+int(m.group(2)))
> +        continue
> +
> +print('</syscalls_info>')
> diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml
> new file mode 100644
> index 0000000..b35125c
> --- /dev/null
> +++ b/gdb/syscalls/arm-linux.xml
> @@ -0,0 +1,398 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2009-2013 Free Software Foundation, Inc.
[...]

The rest looks good to me!  Thanks a lot, and thanks for the script :-).

-- 
Sergio


  parent reply	other threads:[~2013-08-14 19:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 21:04 [RFC][PATCH] Preliminary `catch syscall' support for ARM Linux Samuel Bronson
2013-08-02 16:56 ` Tom Tromey
     [not found] ` <E1V4dYl-0006Y8-79 at hydrogen>
2013-08-02 20:33   ` [PATCH] ARM Linux support for `catch syscall' Samuel Bronson
2013-08-05 17:47     ` Sergio Durigan Junior
2013-08-07 15:28       ` Doug Evans
     [not found]         ` <E1V9fPE-00060l-WC@hydrogen>
2013-08-14 19:29           ` Sergio Durigan Junior [this message]
2013-08-16 18:50             ` [PATCH v2] " Samuel Bronson
2013-08-15 20:05           ` Doug Evans
2013-08-15 20:08             ` Sergio Durigan Junior
2013-08-16 18:53             ` Samuel Bronson
2013-08-16 18:19 Doug Evans
2013-08-22 20:35 ` Sergio Durigan Junior

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=m3eh9wrrzs.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=naesten@gmail.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