diff options
Diffstat (limited to 'gdb/syscalls/arm-linux.py')
-rw-r--r-- | gdb/syscalls/arm-linux.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/gdb/syscalls/arm-linux.py b/gdb/syscalls/arm-linux.py index e3985f8..e9cd00b 100644 --- a/gdb/syscalls/arm-linux.py +++ b/gdb/syscalls/arm-linux.py @@ -12,7 +12,8 @@ import time infname = sys.argv[1] inf = file(infname) -print("""\ +print( + """\ <?xml version="1.0"?> <!-- Copyright (C) 2009-%s Free Software Foundation, Inc. @@ -30,31 +31,33 @@ print("""\ The file mentioned above belongs to the Linux Kernel. Some small hand-edits were made. --> -<syscalls_info>""" % (time.strftime("%Y"), infname)) +<syscalls_info>""" + % (time.strftime("%Y"), infname) +) + def record(name, number, comment=None): - #nm = 'name="%s"' % name - #s = ' <syscall %-30s number="%d"/>' % (nm, number) + # nm = 'name="%s"' % name + # s = ' <syscall %-30s number="%d"/>' % (nm, number) s = ' <syscall name="%s" number="%d"/>' % (name, number) if comment: - s += ' <!-- %s -->' % comment + s += " <!-- %s -->" % comment print(s) + for line in inf: - m = re.match(r'^#define __NR_(\w+)\s+\(__NR_SYSCALL_BASE\+\s*(\d+)\)', - line) + 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) + m = re.match(r"^\s+/\* (\d+) was sys_(\w+) \*/$", line) if m: - record(m.group(2), int(m.group(1)), 'removed') + record(m.group(2), int(m.group(1)), "removed") - m = re.match(r'^#define __ARM_NR_(\w+)\s+\(__ARM_NR_BASE\+\s*(\d+)\)', - line) + 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))) + record("ARM_" + m.group(1), 0x0F0000 + int(m.group(2))) continue -print('</syscalls_info>') +print("</syscalls_info>") |