public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: sergio@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-sergio-catch-syscall: Reviewed xml-syscall.c file. Modified the way syscall_state is stored. Date: Wed, 12 Nov 2008 17:39:00 -0000 [thread overview] Message-ID: <20081112173934.26832.qmail@sourceware.org> (raw) The branch, archer-sergio-catch-syscall has been updated via 505a054d0c8817668cc30397690ad75fe1204113 (commit) via 23412d6f076483ffda183d445829cd78b3bafeba (commit) from 7d98d128a66cec99ae3b4b3719baac14fde0c5b9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 505a054d0c8817668cc30397690ad75fe1204113 Author: Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> Date: Wed Nov 12 09:39:15 2008 -0800 Reviewed xml-syscall.c file. Modified the way syscall_state is stored. commit 23412d6f076483ffda183d445829cd78b3bafeba Author: Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> Date: Tue Nov 11 18:21:19 2008 -0800 Renaming XML files. ----------------------------------------------------------------------- Summary of changes: gdb/Makefile.in | 13 +++-- gdb/configure.tgt | 38 +++++++++------ gdb/linux-tdep.c | 1 - gdb/ppc-linux-tdep.c | 3 + gdb/syscalls/{i386-syscalls.xml => i386-linux.xml} | 0 gdb/syscalls/{ppc-syscalls.xml => ppc-linux.xml} | 0 .../{ppc64-syscalls.xml => ppc64-linux.xml} | 0 gdb/testsuite/gdb.base/catch-syscall.exp | 6 +- gdb/xml-syscall.c | 52 +++++++------------- 9 files changed, 55 insertions(+), 58 deletions(-) rename gdb/syscalls/{i386-syscalls.xml => i386-linux.xml} (100%) rename gdb/syscalls/{ppc-syscalls.xml => ppc-linux.xml} (100%) rename gdb/syscalls/{ppc64-syscalls.xml => ppc64-linux.xml} (100%) First 500 lines of diff: diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 7bbbf59..a775635 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -460,6 +460,7 @@ TARGET_OBS = @TARGET_OBS@ # All target-dependent objects files that require 64-bit CORE_ADDR # (used with --enable-targets=all --enable-64-bit-bfd). ALL_64_TARGET_OBS = \ + linux-tdep.o \ alphabsd-tdep.o alphafbsd-tdep.o alpha-linux-tdep.o alpha-mdebug-tdep.o \ alphanbsd-tdep.o alphaobsd-tdep.o alpha-osf1-tdep.o alpha-tdep.o \ amd64fbsd-tdep.o amd64-linux-tdep.o amd64nbsd-tdep.o amd64obsd-tdep.o \ @@ -471,6 +472,7 @@ ALL_64_TARGET_OBS = \ # All other target-dependent objects files (used with --enable-targets=all). ALL_TARGET_OBS = \ + linux-tdep.o \ armbsd-tdep.o arm-linux-tdep.o armnbsd-tdep.o armobsd-tdep.o \ arm-tdep.o arm-wince-tdep.o \ avr-tdep.o \ @@ -660,6 +662,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ valarith.c valops.c valprint.c value.c varobj.c vec.c \ wrapper.c \ xml-tdesc.c xml-support.c \ + linux-tdep.c \ xml-syscall.c \ inferior.c @@ -671,7 +674,7 @@ LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c # wrong if TAGS has files twice). Because this is tricky to get # right, it is probably easiest just to list .h files here directly. -HFILES_NO_SRCDIR = osf-share/cma_debug_client.h \ +HFILES_NO_SRCDIR = osf-share/cma_debug_client.h linux-tdep.h \ osf-share/HP800/cma_thread_io.h osf-share/cma_sequence.h \ osf-share/cma_mutex.h osf-share/cma_semaphore_defs.h \ osf-share/cma_list.h osf-share/cma_handle.h osf-share/cma_stack.h \ @@ -731,7 +734,7 @@ config/sparc/nm-sol2.h config/nm-linux.h config/mips/nm-irix5.h \ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \ -sentinel-frame.h bcache.h symfile.h xml-syscall.h linux-tdep.h +sentinel-frame.h bcache.h symfile.h xml-syscall.h # Header files that already have srcdir in them, or which are in objdir. @@ -817,8 +820,8 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ # Definitions for the syscall's XML files and dir XML_SYSCALLS_DIR = syscalls/ XML_SYSCALLS_FILES = gdb-syscalls.dtd \ - ppc-syscalls.xml ppc64-syscalls.xml \ - i386-syscalls.xml + ppc-linux.xml ppc64-linux.xml \ + i386-linux.xml TSOBS = inflow.o @@ -859,7 +862,7 @@ all: gdb$(EXEEXT) $(CONFIG_ALL) xml-syscall-copy all-tui: $(TUI)$(EXEEXT) xml-syscall-copy: - if "`cd $(srcdir) && pwd`" != "`pwd`" ; then \ + if [ "`cd $(srcdir) && pwd`" != "`pwd`" ] ; then \ mkdir -p ./$(XML_SYSCALLS_DIR) ; \ list='$(XML_SYSCALLS_FILES)' ; \ for file in $$list ; do \ diff --git a/gdb/configure.tgt b/gdb/configure.tgt index b4ce7ac..9d8103c 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -36,7 +36,7 @@ alpha*-*-osf*) alpha*-*-linux*) # Target: Little-endian Alpha running Linux gdb_target_obs="alpha-tdep.o alpha-mdebug-tdep.o alpha-linux-tdep.o \ - solib.o solib-svr4.o" + solib.o solib-svr4.o linux-tdep.o" ;; alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) # Target: FreeBSD/alpha @@ -63,7 +63,7 @@ alpha*-*-*) am33_2.0*-*-linux*) # Target: Matsushita mn10300 (AM33) running Linux gdb_target_obs="mn10300-tdep.o mn10300-linux-tdep.o corelow.o \ - solib.o solib-svr4.o" + solib.o solib-svr4.o linux-tdep.o" ;; arm*-wince-pe | arm*-*-mingw32ce*) @@ -75,7 +75,8 @@ arm*-wince-pe | arm*-*-mingw32ce*) arm*-*-linux*) # Target: ARM based machine running GNU/Linux gdb_target_obs="arm-tdep.o arm-linux-tdep.o glibc-tdep.o \ - solib.o solib-svr4.o symfile-mem.o corelow.o" + solib.o solib-svr4.o symfile-mem.o corelow.o \ + linux-tdep.o" build_gdbserver=yes ;; arm*-*-netbsd* | arm*-*-knetbsd*-gnu) @@ -128,7 +129,7 @@ hppa*-*-hpux*) hppa*-*-linux*) # Target: HP PA-RISC running Linux gdb_target_obs="hppa-tdep.o hppa-linux-tdep.o glibc-tdep.o \ - solib.o solib-svr4.o symfile-mem.o" + solib.o solib-svr4.o symfile-mem.o linux-tdep.o" ;; hppa*-*-netbsd*) # Target: NetBSD/hppa @@ -185,7 +186,7 @@ i[34567]86-*-solaris*) i[34567]86-*-linux*) # Target: Intel 386 running GNU/Linux gdb_target_obs="i386-tdep.o i386-linux-tdep.o glibc-tdep.o i387-tdep.o \ - solib.o solib-svr4.o symfile-mem.o corelow.o" + solib.o solib-svr4.o symfile-mem.o corelow.o linux-tdep.o" build_gdbserver=yes ;; i[34567]86-*-gnu*) @@ -213,7 +214,7 @@ i[34567]86-*-*) ia64-*-linux*) # Target: Intel IA-64 running GNU/Linux gdb_target_obs="ia64-tdep.o ia64-linux-tdep.o \ - solib.o solib-svr4.o symfile-mem.o" + solib.o solib-svr4.o symfile-mem.o linux-tdep.o" build_gdbserver=yes ;; ia64*-*-*) @@ -237,7 +238,8 @@ m32c-*-*) m32r*-*-linux*) # Target: Renesas M32R running GNU/Linux gdb_target_obs="m32r-tdep.o m32r-linux-tdep.o remote-m32r-sdi.o \ - glibc-tdep.o solib.o solib-svr4.o symfile-mem.o" + glibc-tdep.o solib.o solib-svr4.o symfile-mem.o \ + linux-tdep.o" gdb_sim=../sim/m32r/libsim.a build_gdbserver=yes ;; @@ -262,7 +264,7 @@ fido-*-elf*) m68*-*-linux*) # Target: Motorola m68k with a.out and ELF gdb_target_obs="m68k-tdep.o m68klinux-tdep.o solib.o solib-svr4.o \ - glibc-tdep.o symfile-mem.o" + glibc-tdep.o symfile-mem.o linux-tdep.o" build_gdbserver=yes ;; m68*-*-netbsd* | m68*-*-knetbsd*-gnu) @@ -298,7 +300,8 @@ mips*-sgi-irix6*) mips*-*-linux*) # Target: Linux/MIPS gdb_target_obs="mips-tdep.o mips-linux-tdep.o glibc-tdep.o \ - corelow.o solib.o solib-svr4.o symfile-mem.o" + corelow.o solib.o solib-svr4.o symfile-mem.o \ + linux-tdep.o" gdb_sim=../sim/mips/libsim.a build_gdbserver=yes ;; @@ -349,7 +352,8 @@ powerpc-*-aix* | rs6000-*-*) powerpc-*-linux* | powerpc64-*-linux*) # Target: PowerPC running Linux gdb_target_obs="rs6000-tdep.o ppc-linux-tdep.o ppc-sysv-tdep.o \ - solib.o solib-svr4.o corelow.o symfile-mem.o" + solib.o solib-svr4.o corelow.o symfile-mem.o \ + linux-tdep.o" gdb_sim=../sim/ppc/libsim.a build_gdbserver=yes ;; @@ -376,7 +380,8 @@ score-*-*) sh*-*-linux*) # Target: GNU/Linux Super-H gdb_target_obs="sh-tdep.o sh64-tdep.o sh-linux-tdep.o monitor.o \ - dsrec.o solib.o solib-svr4.o symfile-mem.o glibc-tdep.o" + dsrec.o solib.o solib-svr4.o symfile-mem.o glibc-tdep.o \ + linux-tdep.o" gdb_sim=../sim/sh/libsim.a build_gdbserver=yes ;; @@ -404,13 +409,14 @@ sh*) sparc-*-linux*) # Target: GNU/Linux SPARC gdb_target_obs="sparc-tdep.o sparc-sol2-tdep.o sol2-tdep.o \ - sparc-linux-tdep.o solib.o solib-svr4.o symfile-mem.o" + sparc-linux-tdep.o solib.o solib-svr4.o symfile-mem.o \ + linux-tdep.o" ;; sparc64-*-linux*) # Target: GNU/Linux UltraSPARC gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o sol2-tdep.o \ sparc64-linux-tdep.o sparc-tdep.o sparc-sol2-tdep.o \ - sparc-linux-tdep.o solib.o solib-svr4.o" + sparc-linux-tdep.o solib.o solib-svr4.o linux-tdep.o" ;; sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu) # Target: FreeBSD/sparc64 @@ -507,7 +513,8 @@ x86_64-*-linux*) # Target: GNU/Linux x86-64 gdb_target_obs="amd64-tdep.o amd64-linux-tdep.o i386-tdep.o \ i387-tdep.o i386-linux-tdep.o glibc-tdep.o \ - solib.o solib-svr4.o corelow.o symfile-mem.o" + solib.o solib-svr4.o corelow.o symfile-mem.o \ + linux-tdep.o" build_gdbserver=yes ;; x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) @@ -530,7 +537,8 @@ x86_64-*-openbsd*) xtensa*-*-linux*) gdb_target=linux # Target: GNU/Linux Xtensa gdb_target_obs="xtensa-tdep.o xtensa-config.o xtensa-linux-tdep.o \ - solib.o solib-svr4.o corelow.o symfile-mem.o" + solib.o solib-svr4.o corelow.o symfile-mem.o \ + linux-tdep.o" build_gdbserver=yes ;; xtensa*) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 9f7651d..7e31e5c 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -107,7 +107,6 @@ linux_get_syscall_names (struct gdbarch *gdbarch) void linux_tdep_init (struct gdbarch *gdbarch) { - set_gdbarch_get_syscall_number (gdbarch, linux_get_syscall_number); set_gdbarch_syscall_name_from_number (gdbarch, linux_syscall_name_from_number); set_gdbarch_syscall_number_from_name (gdbarch, linux_syscall_number_from_name); set_gdbarch_get_syscall_names (gdbarch, linux_get_syscall_names); diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index c4a456f..5ac4767 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1107,6 +1107,9 @@ ppc_linux_init_abi (struct gdbarch_info info, /* Handle inferior calls during interrupted system calls. */ set_gdbarch_write_pc (gdbarch, ppc_linux_write_pc); + /* Get the syscall number from the arch's register. */ + set_gdbarch_get_syscall_number (gdbarch, ppc_linux_get_syscall_number); + if (tdep->wordsize == 4) { /* Until November 2001, gcc did not comply with the 32 bit SysV diff --git a/gdb/syscalls/i386-syscalls.xml b/gdb/syscalls/i386-linux.xml similarity index 100% rename from gdb/syscalls/i386-syscalls.xml rename to gdb/syscalls/i386-linux.xml diff --git a/gdb/syscalls/ppc-syscalls.xml b/gdb/syscalls/ppc-linux.xml similarity index 100% rename from gdb/syscalls/ppc-syscalls.xml rename to gdb/syscalls/ppc-linux.xml diff --git a/gdb/syscalls/ppc64-syscalls.xml b/gdb/syscalls/ppc64-linux.xml similarity index 100% rename from gdb/syscalls/ppc64-syscalls.xml rename to gdb/syscalls/ppc64-linux.xml diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index 1358828..3e44c1c 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -67,7 +67,7 @@ proc check_call_to_syscall { syscall_name } { global gdb_prompt set thistest "program has called '$syscall_name'" - gdb_test "continue" "Catchpoint .*(calling syscall .$syscall_name ().).*" $thistest + gdb_test "continue" "Catchpoint .*(calling syscall .$syscall_name.).*" $thistest # Checking if the syscall is reported to be caught in # 'info breakpoints'. @@ -79,7 +79,7 @@ proc check_return_from_syscall { syscall_name } { global gdb_prompt set thistest "syscall '$syscall_name' has returned" - gdb_test "continue" "Catchpoint .*(returned from syscall .$syscall_name ().).*" $thistest + gdb_test "continue" "Catchpoint .*(returned from syscall .$syscall_name.).*" $thistest # Checking if the syscall is reported to be caught in # 'info breakpoints'. @@ -108,7 +108,7 @@ proc insert_catch_syscall_with_arg { syscall_name } { # Trying to set the syscall set thistest "catch syscall with arguments ($syscall_name)" - gdb_test "catch syscall $syscall_name" "Catchpoint .*(syscall .$syscall_name ().).*" $thistest + gdb_test "catch syscall $syscall_name" "Catchpoint .*(syscall .$syscall_name.).*" $thistest } diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index 8f16752..b90888d 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -103,10 +103,6 @@ DEF_VEC_P(syscall_desc_p); struct syscalls_info { - /* The number of syscalls in this system. */ - - int number_of_syscalls; - /* The syscalls. */ VEC(syscall_desc_p) *syscalls; @@ -156,12 +152,6 @@ make_cleanup_free_syscalls_info (struct syscalls_info *sysinfo) return make_cleanup (free_syscalls_info, sysinfo); } -static void -do_cleanup_fclose (void *file) -{ - fclose (file); -} - /* Open FILENAME, read all its text into memory, close it, and return the text. If something goes wrong, return NULL and warn. */ @@ -188,7 +178,7 @@ fetch_xml_from_file (const char *filename, void *baton) if (file == NULL) return NULL; - back_to = make_cleanup (do_cleanup_fclose, file); + back_to = make_cleanup (make_cleanup_fclose, file); /* Read in the whole file, one chunk at a time. */ len = 4096; @@ -247,9 +237,6 @@ syscall_start_syscalls_info (struct gdb_xml_parser *parser, { struct syscall_parsing_data *data = user_data; struct syscalls_info *sysinfo = data->sysinfo; - - /* Initializing fields. */ - sysinfo->number_of_syscalls = 0; } /* Handle the start of a <syscall> element. */ @@ -280,43 +267,40 @@ syscall_start_syscall (struct gdb_xml_parser *parser, } syscall_create_syscall_desc (data->sysinfo, name, number); - - data->sysinfo->number_of_syscalls++; } /* The elements and attributes of an XML syscall document. */ static const struct gdb_xml_attribute syscall_attr[] = { - { "number", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, - { "name", GDB_XML_AF_NONE, NULL, NULL }, - { NULL, GDB_XML_AF_NONE, NULL, NULL } + { "number", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "name", GDB_XML_AF_NONE, NULL, NULL }, + { NULL, GDB_XML_AF_NONE, NULL, NULL } }; static const struct gdb_xml_element syscalls_info_children[] = { - { "syscall", syscall_attr, NULL, - GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, - syscall_start_syscall, NULL }, - { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } + { "syscall", syscall_attr, NULL, + GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, + syscall_start_syscall, NULL }, + { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } }; static const struct gdb_xml_element syselements[] = { - { "syscalls_info", NULL, syscalls_info_children, - GDB_XML_EF_NONE, syscall_start_syscalls_info, NULL }, - { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } + { "syscalls_info", NULL, syscalls_info_children, + GDB_XML_EF_NONE, syscall_start_syscalls_info, NULL }, + { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } }; static struct syscalls_info * syscall_parse_xml (const char *document, xml_fetch_another fetcher, void *fetcher_baton) { - struct cleanup *back_to, *result_cleanup; + struct cleanup *result_cleanup; struct gdb_xml_parser *parser; struct syscall_parsing_data data; char *expanded_text; int i; - back_to = make_cleanup (null_cleanup, NULL); parser = gdb_xml_create_parser_and_cleanup (_("syscalls info"), syselements, &data); @@ -328,13 +312,12 @@ syscall_parse_xml (const char *document, xml_fetch_another fetcher, { /* Parsed successfully. */ discard_cleanups (result_cleanup); - do_cleanups (back_to); return data.sysinfo; } else { warning (_("Could not load XML syscalls info; ignoring")); - do_cleanups (back_to); + do_cleanups (result_cleanup); return NULL; } } @@ -394,8 +377,7 @@ xml_get_syscall_name (const struct syscalls_info *sysinfo, int i; if (sysinfo == NULL - || syscall_number < 0 - || syscall_number >= sysinfo->number_of_syscalls) + || syscall_number < 0) return NULL; for (i = 0; @@ -410,7 +392,8 @@ xml_get_syscall_name (const struct syscalls_info *sysinfo, int xml_number_of_syscalls (const struct syscalls_info *sysinfo) { - return (sysinfo == NULL ? 0 : sysinfo->number_of_syscalls); + return (sysinfo == NULL ? 0 : VEC_length(syscall_desc_p, + sysinfo->syscalls)); } const char ** @@ -418,12 +401,13 @@ xml_list_of_syscalls (const struct syscalls_info *sysinfo) { struct syscall_desc *sysdesc; const char **names = NULL; + int nsyscalls = VEC_length(syscall_desc_p, sysinfo->syscalls); int i; if (sysinfo == NULL) return NULL; - names = xmalloc ((sysinfo->number_of_syscalls + 1) * sizeof (char *)); + names = xmalloc ((nsyscalls + 1) * sizeof (char *)); for (i = 0; VEC_iterate(syscall_desc_p, sysinfo->syscalls, i, sysdesc); hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2008-11-12 17:39 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20081112173934.26832.qmail@sourceware.org \ --to=sergio@sourceware.org \ --cc=archer-commits@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).