From patchwork Thu Nov 13 00:18:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 3685 Received: (qmail 9404 invoked by alias); 13 Nov 2014 00:18:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 9388 invoked by uid 89); 13 Nov 2014 00:18:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 13 Nov 2014 00:18:17 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAD0ID48020741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Nov 2014 19:18:13 -0500 Received: from psique.yyz.redhat.com (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAD0IBQg005720; Wed, 12 Nov 2014 19:18:12 -0500 From: Sergio Durigan Junior To: GDB Patches Cc: Pedro Alves , Gabriel Krisman Bertazi , Sergio Durigan Junior Subject: [PATCH 2/3] Adjust calls for setting "catch syscall" information Date: Wed, 12 Nov 2014 19:18:06 -0500 Message-Id: <1415837887-28888-3-git-send-email-sergiodj@redhat.com> In-Reply-To: <1415837887-28888-1-git-send-email-sergiodj@redhat.com> References: <1415837887-28888-1-git-send-email-sergiodj@redhat.com> X-IsSubscribed: yes This patch adjusts the calls to several functions exported by gdb/xml-syscall.c. Now, we should receive a "gdbarch" argument that refers to the architecture being used. It is the logical move after patch #1, so it's very trivial. gdb/ 2014-11-12 Sergio Durigan Junior PR breakpoints/10737 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Adjust call to set_xml_syscall_file_name to provide gdbarch. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * bfin-linux-tdep.c (bfin_linux_init_abi): Likewise. * breakpoint.c (print_it_catch_syscall): Adjust call to get_syscall_by_number to provide gdbarch. (print_one_catch_syscall): Likewise. (print_mention_catch_syscall): Likewise. (print_recreate_catch_syscall): Likewise. (catch_syscall_split_args): Adjust calls to get_syscall_by_number and get_syscall_by_name to provide gdbarch. (catch_syscall_completer): Adjust call to get_syscall_names to provide gdbarch. * i386-linux-tdep.c (i386_linux_init_abi): Adjust call to set_xml_syscall_file_name to provide gdbarch. * mips-linux-tdep.c (mips_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise. * sparc64-linux-tdep.c (sparc64_linux_init_abi): Likewise. --- gdb/amd64-linux-tdep.c | 2 +- gdb/arm-linux-tdep.c | 2 +- gdb/bfin-linux-tdep.c | 2 +- gdb/breakpoint.c | 21 +++++++++++++-------- gdb/i386-linux-tdep.c | 2 +- gdb/mips-linux-tdep.c | 6 +++--- gdb/ppc-linux-tdep.c | 4 ++-- gdb/s390-linux-tdep.c | 4 ++-- gdb/sparc-linux-tdep.c | 2 +- gdb/sparc64-linux-tdep.c | 2 +- 10 files changed, 26 insertions(+), 21 deletions(-) diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index edbb1b3..27a3560 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1663,7 +1663,7 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) tdep->register_reggroup_p = amd64_linux_register_reggroup_p; /* Functions for 'catch syscall'. */ - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_AMD64); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_AMD64); set_gdbarch_get_syscall_number (gdbarch, amd64_linux_get_syscall_number); diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 2e79658..fa28695 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -1468,7 +1468,7 @@ arm_linux_init_abi (struct gdbarch_info info, tdep->syscall_next_pc = arm_linux_syscall_next_pc; /* `catch syscall' */ - set_xml_syscall_file_name ("syscalls/arm-linux.xml"); + set_xml_syscall_file_name (gdbarch, "syscalls/arm-linux.xml"); set_gdbarch_get_syscall_number (gdbarch, arm_linux_get_syscall_number); /* Syscall record. */ diff --git a/gdb/bfin-linux-tdep.c b/gdb/bfin-linux-tdep.c index 8471ec7..c3e37c0 100644 --- a/gdb/bfin-linux-tdep.c +++ b/gdb/bfin-linux-tdep.c @@ -157,7 +157,7 @@ bfin_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tramp_frame_prepend_unwinder (gdbarch, &bfin_linux_sigframe); /* Functions for 'catch syscall'. */ - set_xml_syscall_file_name ("syscalls/bfin-linux.xml"); + set_xml_syscall_file_name (gdbarch, "syscalls/bfin-linux.xml"); set_gdbarch_get_syscall_number (gdbarch, bfin_linux_get_syscall_number); } diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3ebe9c9..2e19602 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8607,10 +8607,11 @@ print_it_catch_syscall (bpstat bs) ptid_t ptid; struct target_waitstatus last; struct syscall s; + struct gdbarch *gdbarch = target_gdbarch (); get_last_target_status (&ptid, &last); - get_syscall_by_number (last.value.syscall_number, &s); + get_syscall_by_number (gdbarch, last.value.syscall_number, &s); annotate_catchpoint (b->number); @@ -8653,6 +8654,7 @@ print_one_catch_syscall (struct breakpoint *b, struct syscall_catchpoint *c = (struct syscall_catchpoint *) b; struct value_print_options opts; struct ui_out *uiout = current_uiout; + struct gdbarch *gdbarch = target_gdbarch (); get_user_print_options (&opts); /* Field 4, the address, is omitted (which makes the columns not @@ -8679,7 +8681,7 @@ print_one_catch_syscall (struct breakpoint *b, { char *x = text; struct syscall s; - get_syscall_by_number (iter, &s); + get_syscall_by_number (gdbarch, iter, &s); if (s.name != NULL) text = xstrprintf ("%s%s, ", text, s.name); @@ -8710,6 +8712,7 @@ static void print_mention_catch_syscall (struct breakpoint *b) { struct syscall_catchpoint *c = (struct syscall_catchpoint *) b; + struct gdbarch *gdbarch = target_gdbarch (); if (c->syscalls_to_be_caught) { @@ -8725,7 +8728,7 @@ print_mention_catch_syscall (struct breakpoint *b) i++) { struct syscall s; - get_syscall_by_number (iter, &s); + get_syscall_by_number (gdbarch, iter, &s); if (s.name) printf_filtered (" '%s' [%d]", s.name, s.number); @@ -8746,6 +8749,7 @@ static void print_recreate_catch_syscall (struct breakpoint *b, struct ui_file *fp) { struct syscall_catchpoint *c = (struct syscall_catchpoint *) b; + struct gdbarch *gdbarch = target_gdbarch (); fprintf_unfiltered (fp, "catch syscall"); @@ -8759,7 +8763,7 @@ print_recreate_catch_syscall (struct breakpoint *b, struct ui_file *fp) { struct syscall s; - get_syscall_by_number (iter, &s); + get_syscall_by_number (gdbarch, iter, &s); if (s.name) fprintf_unfiltered (fp, " %s", s.name); else @@ -12035,6 +12039,7 @@ catch_syscall_split_args (char *arg) { VEC(int) *result = NULL; struct cleanup *cleanup = make_cleanup (VEC_cleanup (int), &result); + struct gdbarch *gdbarch = target_gdbarch (); while (*arg != '\0') { @@ -12054,12 +12059,12 @@ catch_syscall_split_args (char *arg) /* Check if the user provided a syscall name or a number. */ syscall_number = (int) strtol (cur_name, &endptr, 0); if (*endptr == '\0') - get_syscall_by_number (syscall_number, &s); + get_syscall_by_number (gdbarch, syscall_number, &s); else { /* We have a name. Let's check if it's valid and convert it to a number. */ - get_syscall_by_name (cur_name, &s); + get_syscall_by_name (gdbarch, cur_name, &s); if (s.number == UNKNOWN_SYSCALL) /* Here we have to issue an error instead of a warning, @@ -12100,7 +12105,7 @@ this architecture yet.")); to get the syscall XML file loaded or, most important, to display a warning to the user if there's no XML file for his/her architecture. */ - get_syscall_by_number (0, &s); + get_syscall_by_number (gdbarch, 0, &s); /* The allowed syntax is: catch syscall @@ -15343,7 +15348,7 @@ static VEC (char_ptr) * catch_syscall_completer (struct cmd_list_element *cmd, const char *text, const char *word) { - const char **list = get_syscall_names (); + const char **list = get_syscall_names (target_gdbarch ()); VEC (char_ptr) *retlist = (list == NULL) ? NULL : complete_on_enum (list, word, word); diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 7feb21d..b45c230 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -994,7 +994,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) displaced_step_at_entry_point); /* Functions for 'catch syscall'. */ - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_I386); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_I386); set_gdbarch_get_syscall_number (gdbarch, i386_linux_get_syscall_number); diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index c2cec3d..bc42921 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -1558,7 +1558,7 @@ mips_linux_init_abi (struct gdbarch_info info, (gdbarch, svr4_ilp32_fetch_link_map_offsets); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_sigframe); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_rt_sigframe); - set_xml_syscall_file_name ("syscalls/mips-o32-linux.xml"); + set_xml_syscall_file_name (gdbarch, "syscalls/mips-o32-linux.xml"); break; case MIPS_ABI_N32: set_gdbarch_get_longjmp_target (gdbarch, @@ -1572,7 +1572,7 @@ mips_linux_init_abi (struct gdbarch_info info, does not distinguish between quiet and signalling NaNs). */ set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n32_rt_sigframe); - set_xml_syscall_file_name ("syscalls/mips-n32-linux.xml"); + set_xml_syscall_file_name (gdbarch, "syscalls/mips-n32-linux.xml"); break; case MIPS_ABI_N64: set_gdbarch_get_longjmp_target (gdbarch, @@ -1586,7 +1586,7 @@ mips_linux_init_abi (struct gdbarch_info info, does not distinguish between quiet and signalling NaNs). */ set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n64_rt_sigframe); - set_xml_syscall_file_name ("syscalls/mips-n64-linux.xml"); + set_xml_syscall_file_name (gdbarch, "syscalls/mips-n64-linux.xml"); break; default: break; diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index a997869..fa51ed0 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1294,7 +1294,7 @@ ppc_linux_init_abi (struct gdbarch_info info, (gdbarch, svr4_ilp32_fetch_link_map_offsets); /* Setting the correct XML syscall filename. */ - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_PPC); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_PPC); /* Trampolines. */ tramp_frame_prepend_unwinder (gdbarch, @@ -1346,7 +1346,7 @@ ppc_linux_init_abi (struct gdbarch_info info, (gdbarch, svr4_lp64_fetch_link_map_offsets); /* Setting the correct XML syscall filename. */ - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_PPC64); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_PPC64); /* Trampolines. */ tramp_frame_prepend_unwinder (gdbarch, diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c index abd2e40..b5d94ce 100644 --- a/gdb/s390-linux-tdep.c +++ b/gdb/s390-linux-tdep.c @@ -3107,7 +3107,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_S390); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_S390); break; case ABI_LINUX_ZSERIES: @@ -3122,7 +3122,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) s390_address_class_type_flags_to_name); set_gdbarch_address_class_name_to_type_flags (gdbarch, s390_address_class_name_to_type_flags); - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_S390); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_S390); break; } diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c index fd1fc3d..ec7d84d 100644 --- a/gdb/sparc-linux-tdep.c +++ b/gdb/sparc-linux-tdep.c @@ -455,7 +455,7 @@ sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_write_pc (gdbarch, sparc_linux_write_pc); /* Functions for 'catch syscall'. */ - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_SPARC32); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_SPARC32); set_gdbarch_get_syscall_number (gdbarch, sparc32_linux_get_syscall_number); diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c index e843eb3..0dd47d0 100644 --- a/gdb/sparc64-linux-tdep.c +++ b/gdb/sparc64-linux-tdep.c @@ -336,7 +336,7 @@ sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_write_pc (gdbarch, sparc64_linux_write_pc); /* Functions for 'catch syscall'. */ - set_xml_syscall_file_name (XML_SYSCALL_FILENAME_SPARC64); + set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_SPARC64); set_gdbarch_get_syscall_number (gdbarch, sparc64_linux_get_syscall_number); }