]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Implement catch syscall group
authorGabriel Krisman Bertazi <gabriel@krisman.be>
Sat, 23 Jul 2016 21:38:24 +0000 (18:38 -0300)
committerGabriel Krisman Bertazi <gabriel@krisman.be>
Sat, 23 Jul 2016 21:38:24 +0000 (18:38 -0300)
commite34879080d8935792ef3942efa5f25b4c3169b5a
treedaab863d91a6bb66ab2c10f1f4ef50b52dab66ea
parent49ecef2a7da2ee9df4ae675f99b70518fbf1bb23
Implement catch syscall group

Implement support to add catchpoints for a group of related syscalls
using the syntax:

(gdb) catch syscall group:<group>
or
(gdb) catch syscall g:<group>

Several groups are predefined in the xml files for all architectures
supported by GDB over Linux.  They are based on the groups defined by
strace.

gdb/

* xml-syscall.c (get_syscalls_by_group): New.
(get_syscall_group_names): New.
(struct syscall_group_desc): New structure to store group data.
(struct syscalls_info): Include field to store the group list.
(sysinfo_free_syscall_group_desc): New.
(free_syscalls_info): Free group list.
(syscall_group_create_syscall_group_desc): New.
(syscall_group_add_syscall): New.
(syscall_create_syscall_desc): Add syscall to its groups.
(syscall_start_syscall): Load group attribute.
(syscall_group_get_group_by_name): New.
(xml_list_syscalls_by_group): New.
(xml_list_of_groups): New.
* xml-syscall.h (get_syscalls_by_group): Export function
to retrieve a list of syscalls filtered by the group name.
(get_syscall_group_names): Export function to retrieve the list
of syscall groups.
* break-catch-syscall.c (catch_syscall_split_args): Verify if
argument is a syscall group and expand it to a list of syscalls
when creating catchpoints.
(catch_syscall_completer): Add word completion for system call
groups.
* configure.ac: Include dependency for xsltproc when building
in maintainer-mode.
* break-catch-syscall.c (_initialize_breakpoint): Update catch
syscall command documentation.
* NEWS: Include section about catching groups of syscalls.
* configure: Regenerate.
* data-directory/Makefile.in: Generate syscall xml when building
in maintainer mode.
* syscalls/gdb-syscalls.dtd: Include group attribute to the
syscall element.
* syscalls/apply-defaults.xsl: New.
* syscalls/linux-defaults.xml.in: New.
* syscalls/aarch64-linux.xml: Rename to aarch64-linux.xml.in.
* syscalls/amd64-linux.xml: Rename to amd64-linux.xml.in.
* syscalls/arm-linux.xml: Rename to arm-linux.xml.in.
* syscalls/bfin-linux.xml: Rename to bfin-linux.xml.in.
* syscalls/i386-linux.xml: Rename to i386-linux.xml.in.
* syscalls/mips-n32-linux.xml: Rename to mips-n32-linux.xml.in.
* syscalls/mips-n64-linux.xml: Rename to mips-n64-linux.xml.in.
* syscalls/mips-o32-linux.xml: Rename to mips-o32-linux.xml.in.
* syscalls/ppc-linux.xml: Rename to ppc-linux.xml.in.
* syscalls/ppc64-linux.xml: Rename to ppc64-linux.xml.in.
* syscalls/s390-linux.xml: Rename to s390-linux.xml.in.
* syscalls/s390x-linux.xml: Rename to s390x-linux.xml.in.
* syscalls/sparc-linux.xml: Rename to sparc-linux.xml.in.
* syscalls/sparc64-linux.xml: Rename to sparc64-linux.xml.in.
* syscalls/aarch64-linux.xml: Regenerate.
* syscalls/amd64-linux.xml: Regenerate.
* syscalls/arm-linux.xml: Regenerate.
* syscalls/i386-linux.xml: Regenerate.
* syscalls/mips-n32-linux.xml: Regenerate.
* syscalls/mips-n64-linux.xml: Regenerate.
* syscalls/mips-o32-linux.xml: Regenerate.
* syscalls/ppc-linux.xml: Regenerate.
* syscalls/ppc64-linux.xml: Regenerate.
* syscalls/s390-linux.xml: Regenerate.
* syscalls/s390x-linux.xml: Regenerate.
* syscalls/sparc-linux.xml: Regenerate.
* syscalls/sparc64-linux.xml: Regenerate.

gdb/testsuite/

* gdb.base/catch-syscall.exp (do_syscall_tests): Add call
to test_catch_syscall_group.
(test_catch_syscall_group): New.

gdb/doc/

* gdb.texinfo (Set Catchpoints): Add 'group' argument to catch
syscall.
42 files changed:
gdb/ChangeLog
gdb/NEWS
gdb/break-catch-syscall.c
gdb/configure
gdb/configure.ac
gdb/data-directory/Makefile.in
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/syscalls/aarch64-linux.xml
gdb/syscalls/aarch64-linux.xml.in [new file with mode: 0644]
gdb/syscalls/amd64-linux.xml
gdb/syscalls/amd64-linux.xml.in [new file with mode: 0644]
gdb/syscalls/apply-defaults.xsl [new file with mode: 0644]
gdb/syscalls/arm-linux.xml
gdb/syscalls/arm-linux.xml.in [new file with mode: 0644]
gdb/syscalls/bfin-linux.xml.in [moved from gdb/syscalls/bfin-linux.xml with 100% similarity]
gdb/syscalls/gdb-syscalls.dtd
gdb/syscalls/i386-linux.xml
gdb/syscalls/i386-linux.xml.in [new file with mode: 0644]
gdb/syscalls/linux-defaults.xml.in [new file with mode: 0644]
gdb/syscalls/mips-n32-linux.xml
gdb/syscalls/mips-n32-linux.xml.in [new file with mode: 0644]
gdb/syscalls/mips-n64-linux.xml
gdb/syscalls/mips-n64-linux.xml.in [new file with mode: 0644]
gdb/syscalls/mips-o32-linux.xml
gdb/syscalls/mips-o32-linux.xml.in [new file with mode: 0644]
gdb/syscalls/ppc-linux.xml
gdb/syscalls/ppc-linux.xml.in [new file with mode: 0644]
gdb/syscalls/ppc64-linux.xml
gdb/syscalls/ppc64-linux.xml.in [new file with mode: 0644]
gdb/syscalls/s390-linux.xml
gdb/syscalls/s390-linux.xml.in [new file with mode: 0644]
gdb/syscalls/s390x-linux.xml
gdb/syscalls/s390x-linux.xml.in [new file with mode: 0644]
gdb/syscalls/sparc-linux.xml
gdb/syscalls/sparc-linux.xml.in [new file with mode: 0644]
gdb/syscalls/sparc64-linux.xml
gdb/syscalls/sparc64-linux.xml.in [new file with mode: 0644]
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/catch-syscall.exp
gdb/xml-syscall.c
gdb/xml-syscall.h