[0/2] Autogenerate gdb/syscalls/linux-defaults.xml.in (syscall groups) from strace sources

Message ID 20230224232650.4031472-1-pedro@palves.net
Headers
Series Autogenerate gdb/syscalls/linux-defaults.xml.in (syscall groups) from strace sources |

Message

Pedro Alves Feb. 24, 2023, 11:26 p.m. UTC
  While working on the step-over-thread-clone/exit series, I noticed
that one of the new tests was failing.  The test does "catch syscall
clone", and expects that pthread_create calls clone.  Turns out that
on the glibc shipped with Ubuntu 22.04, pthread_create calls clone3,
not clone.  To make the test cope with that, I thought of switching it
to "catch syscall group:process".  Surprisingly, that catches "clone",
but not "clone3".

This series fixes that, by adding a script that extracts the syscall
group info out the strace sources.

Pedro Alves (2):
  Autogenerate gdb/syscalls/linux-defaults.xml.in (groups) from strace
    sources
  Regenerate Linux syscall group info

 gdb/syscalls/aarch64-linux.xml        |  26 +-
 gdb/syscalls/amd64-linux.xml          | 106 ++---
 gdb/syscalls/arm-linux.xml            |  26 +-
 gdb/syscalls/bfin-linux.xml           |  26 +-
 gdb/syscalls/i386-linux.xml           | 124 +++---
 gdb/syscalls/linux-defaults.xml.in    | 545 ++++++++++++++++----------
 gdb/syscalls/mips-n32-linux.xml       | 122 +++---
 gdb/syscalls/mips-n64-linux.xml       | 100 ++---
 gdb/syscalls/mips-o32-linux.xml       | 122 +++---
 gdb/syscalls/ppc-linux.xml            | 124 +++---
 gdb/syscalls/ppc64-linux.xml          | 104 ++---
 gdb/syscalls/s390-linux.xml           | 122 +++---
 gdb/syscalls/s390x-linux.xml          | 102 ++---
 gdb/syscalls/sparc-linux.xml          | 114 +++---
 gdb/syscalls/sparc64-linux.xml        |  94 ++---
 gdb/syscalls/update-linux-defaults.sh |  95 +++++
 16 files changed, 1096 insertions(+), 856 deletions(-)
 create mode 100755 gdb/syscalls/update-linux-defaults.sh


base-commit: 2e977d9901393ea1bacbe1896af0929e968bc811
  

Comments

Tom de Vries Feb. 25, 2023, 9:31 a.m. UTC | #1
On 2/25/23 00:26, Pedro Alves wrote:
> While working on the step-over-thread-clone/exit series, I noticed
> that one of the new tests was failing.  The test does "catch syscall
> clone", and expects that pthread_create calls clone.  Turns out that
> on the glibc shipped with Ubuntu 22.04, pthread_create calls clone3,
> not clone.  To make the test cope with that, I thought of switching it
> to "catch syscall group:process".  Surprisingly, that catches "clone",
> but not "clone3".
> 
> This series fixes that, by adding a script that extracts the syscall
> group info out the strace sources.
> 

If I understand correctly, this is orthogonal to update-linux-from-src.sh ?

[ FWIW, i've just ran update-linux-from-src.sh with linux kernel sources 
v6.2, and there where no changes. ]

Thanks,
- Tom

> Pedro Alves (2):
>    Autogenerate gdb/syscalls/linux-defaults.xml.in (groups) from strace
>      sources
>    Regenerate Linux syscall group info
> 
>   gdb/syscalls/aarch64-linux.xml        |  26 +-
>   gdb/syscalls/amd64-linux.xml          | 106 ++---
>   gdb/syscalls/arm-linux.xml            |  26 +-
>   gdb/syscalls/bfin-linux.xml           |  26 +-
>   gdb/syscalls/i386-linux.xml           | 124 +++---
>   gdb/syscalls/linux-defaults.xml.in    | 545 ++++++++++++++++----------
>   gdb/syscalls/mips-n32-linux.xml       | 122 +++---
>   gdb/syscalls/mips-n64-linux.xml       | 100 ++---
>   gdb/syscalls/mips-o32-linux.xml       | 122 +++---
>   gdb/syscalls/ppc-linux.xml            | 124 +++---
>   gdb/syscalls/ppc64-linux.xml          | 104 ++---
>   gdb/syscalls/s390-linux.xml           | 122 +++---
>   gdb/syscalls/s390x-linux.xml          | 102 ++---
>   gdb/syscalls/sparc-linux.xml          | 114 +++---
>   gdb/syscalls/sparc64-linux.xml        |  94 ++---
>   gdb/syscalls/update-linux-defaults.sh |  95 +++++
>   16 files changed, 1096 insertions(+), 856 deletions(-)
>   create mode 100755 gdb/syscalls/update-linux-defaults.sh
> 
> 
> base-commit: 2e977d9901393ea1bacbe1896af0929e968bc811
  
Pedro Alves Feb. 27, 2023, 2:53 p.m. UTC | #2
On 2023-02-25 9:31 a.m., Tom de Vries wrote:
> On 2/25/23 00:26, Pedro Alves wrote:
>> While working on the step-over-thread-clone/exit series, I noticed
>> that one of the new tests was failing.  The test does "catch syscall
>> clone", and expects that pthread_create calls clone.  Turns out that
>> on the glibc shipped with Ubuntu 22.04, pthread_create calls clone3,
>> not clone.  To make the test cope with that, I thought of switching it
>> to "catch syscall group:process".  Surprisingly, that catches "clone",
>> but not "clone3".
>>
>> This series fixes that, by adding a script that extracts the syscall
>> group info out the strace sources.
>>
> 
> If I understand correctly, this is orthogonal to update-linux-from-src.sh ?

Right.  This generates the linux-defaults.xml.in file, which is not generated
by update-linux-from-src.sh.  The groups info is not found in the kernel.
linux-defaults.xml.in maps between syscall names and groups.  The arch xml.in files
map syscall number to name.  The makefile combines each arch xml.in with
linux-defaults.xml.in generating a final .xml file with maps the number to
name, and to groups.

> [ FWIW, i've just ran update-linux-from-src.sh with linux kernel sources v6.2, and there where no changes. ]

Great, I was wondering whether we needed to re-run that with a recent kernel.  Thanks for
taking care of it.

Pedro Alves