aboutsummaryrefslogtreecommitdiff
path: root/gdb/data-directory
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <gabriel@krisman.be>2016-07-23 18:38:24 -0300
committerGabriel Krisman Bertazi <gabriel@krisman.be>2016-07-23 18:38:24 -0300
commite34879080d8935792ef3942efa5f25b4c3169b5a (patch)
treedaab863d91a6bb66ab2c10f1f4ef50b52dab66ea /gdb/data-directory
parent49ecef2a7da2ee9df4ae675f99b70518fbf1bb23 (diff)
downloadgdb-e34879080d8935792ef3942efa5f25b4c3169b5a.zip
gdb-e34879080d8935792ef3942efa5f25b4c3169b5a.tar.gz
gdb-e34879080d8935792ef3942efa5f25b4c3169b5a.tar.bz2
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.
Diffstat (limited to 'gdb/data-directory')
-rw-r--r--gdb/data-directory/Makefile.in25
1 files changed, 20 insertions, 5 deletions
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 0beca55..3f23516 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -22,6 +22,7 @@ PYTHON_SRCDIR = $(srcdir)/../python/lib
GUILE_SRCDIR = $(srcdir)/../guile/lib
SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit
VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(GUILE_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR)
+XSLTPROC = @XSLTPROC@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
@@ -44,15 +45,14 @@ GDB_DATADIR = @GDB_DATADIR@
SYSCALLS_DIR = syscalls
SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
-SYSCALLS_FILES = \
- gdb-syscalls.dtd \
- arm-linux.xml aarch64-linux.xml \
+GEN_SYSCALLS_FILES = arm-linux.xml aarch64-linux.xml \
ppc-linux.xml ppc64-linux.xml \
i386-linux.xml amd64-linux.xml \
sparc-linux.xml sparc64-linux.xml \
mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
- s390-linux.xml s390x-linux.xml \
- freebsd.xml
+ s390-linux.xml s390x-linux.xml
+
+SYSCALLS_FILES = gdb-syscalls.dtd freebsd.xml $(GEN_SYSCALLS_FILES)
PYTHON_DIR = python
PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
@@ -163,6 +163,21 @@ FLAGS_TO_PASS = \
.PHONY: all
all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
+%.xml: @MAINTAINER_MODE_TRUE@ %.xml.in apply-defaults.xsl linux-defaults.xml.in
+ $(XSLTPROC) -o $(SYSCALLS_SRCDIR)/$@ $(SYSCALLS_SRCDIR)/apply-defaults.xsl\
+ $(SYSCALLS_SRCDIR)/$@.in
+
+.PHONY: syscall-xml
+syscall-xml: $(GEN_SYSCALLS_FILES)
+
+.PHONY: clean-syscall-xml
+# Only clean files generated XML files.
+clean-syscall-xml:
+ files='$(GEN_SYSCALLS_FILES)' ; \
+ for file in $$files; do \
+ rm -f "$(SYSCALLS_SRCDIR)/$$file"; \
+ done
+
# For portability's sake, we need to handle systems that don't have
# symbolic links.
stamp-syscalls: Makefile $(SYSCALLS_FILES)