diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-04-26 11:06:27 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-04-26 11:50:51 -0400 |
commit | 7c45c0c0fa8e2d8d9501b4fc108a456a3842e502 (patch) | |
tree | c33b9446a8f6db6cd480ea963bad7e42240ced4d /gdb/syscalls/arm-linux.py | |
parent | bea3329b76cf131ad4ac27acb6728b38984998b9 (diff) | |
download | gdb-users/simark/black.zip gdb-users/simark/black.tar.gz gdb-users/simark/black.tar.bz2 |
gdb: re-format Python files using black 21.4b0users/simark/black
Re-format all Python files using black [1] version 21.4b0.
This specific version (currently the latest) can be installed using:
$ pip3 install 'black == 21.4b0'
All you need to do to re-format files is run `black <file/directory>`,
and black will re-format any Python file it finds in there. It runs
quite fast, so the simplest is probably to do:
$ black gdb/
from the top-level.
Change-Id: I28588a22c2406afd6bc2703774ddfff47cd61919
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>") |