From 5cd867b414fe3609dbf596c373343474132775a8 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 24 Jun 2015 14:53:03 +0100 Subject: [PATCH] Call set_gdbarch_get_siginfo_type in linux_init_abi linux_get_siginfo_type is installed to many linux gdbarch. This patch is to move this to a common area linux-tdep.c:linux_init_abi, so that linux_get_siginfo_type is installed to every linux gdbarch. If some linux gdbarch needs its own version, please override it in $ARCH_linux_init_abi. In the testsuite, we enable siginfo related tests for all linux targets. gdb: 2015-06-24 Yao Qi * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't call set_gdbarch_get_siginfo_type. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * m68klinux-tdep.c (m68k_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * tilegx-linux-tdep.c (tilegx_linux_init_abi): Likewise. * linux-tdep.c (linux_get_siginfo_type): Change it to static. (linux_init_abi): Call set_gdbarch_get_siginfo_type. * linux-tdep.h (linux_get_siginfo_type): Remove the declaration. gdb/testsuite: 2015-06-24 Yao Qi * lib/gdb.exp (supports_get_siginfo_type): Return 1 for all linux targets. --- gdb/ChangeLog | 15 +++++++++++++++ gdb/aarch64-linux-tdep.c | 1 - gdb/amd64-linux-tdep.c | 2 -- gdb/arm-linux-tdep.c | 2 -- gdb/i386-linux-tdep.c | 2 -- gdb/linux-tdep.c | 3 ++- gdb/linux-tdep.h | 2 -- gdb/m68klinux-tdep.c | 2 -- gdb/ppc-linux-tdep.c | 2 -- gdb/s390-linux-tdep.c | 2 -- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/gdb.exp | 4 +--- gdb/tilegx-linux-tdep.c | 2 -- 13 files changed, 23 insertions(+), 21 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0d0fe107ad7..3603241abc1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +2015-06-24 Yao Qi + + * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't call + set_gdbarch_get_siginfo_type. + * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise. + * arm-linux-tdep.c (arm_linux_init_abi): Likewise. + * i386-linux-tdep.c (i386_linux_init_abi): Likewise. + * m68klinux-tdep.c (m68k_linux_init_abi): Likewise. + * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. + * s390-linux-tdep.c (s390_gdbarch_init): Likewise. + * tilegx-linux-tdep.c (tilegx_linux_init_abi): Likewise. + * linux-tdep.c (linux_get_siginfo_type): Change it to static. + (linux_init_abi): Call set_gdbarch_get_siginfo_type. + * linux-tdep.h (linux_get_siginfo_type): Remove the declaration. + 2015-06-24 Gary Benson * common/buffer.c (stdint.h): Do not include. diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 2f93846038a..f8cf43e26da 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -962,7 +962,6 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); tramp_frame_prepend_unwinder (gdbarch, &aarch64_linux_rt_sigframe); /* Enable longjmp. */ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 2a8de82e6f0..e9be9cfd1f0 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1835,8 +1835,6 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location); - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); - set_gdbarch_process_record (gdbarch, i386_process_record); set_gdbarch_process_record_signal (gdbarch, amd64_linux_record_signal); } diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index fd0ef5bfdd4..6273027e03c 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -1440,8 +1440,6 @@ arm_linux_init_abi (struct gdbarch_info info, (gdbarch, arm_linux_iterate_over_regset_sections); set_gdbarch_core_read_description (gdbarch, arm_linux_core_read_description); - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); - /* Displaced stepping. */ set_gdbarch_displaced_step_copy_insn (gdbarch, arm_linux_displaced_step_copy_insn); diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 7c2e322f8aa..20229276b9b 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -994,8 +994,6 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_I386); set_gdbarch_get_syscall_number (gdbarch, i386_linux_get_syscall_number); - - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index c81f71bfd42..ff3ada78c6b 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -243,7 +243,7 @@ get_linux_inferior_data (void) /* This function is suitable for architectures that don't extend/override the standard siginfo structure. */ -struct type * +static struct type * linux_get_siginfo_type (struct gdbarch *gdbarch) { struct linux_gdbarch_data *linux_gdbarch_data; @@ -2440,6 +2440,7 @@ linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_vsyscall_range (gdbarch, linux_vsyscall_range); set_gdbarch_infcall_mmap (gdbarch, linux_infcall_mmap); set_gdbarch_infcall_munmap (gdbarch, linux_infcall_munmap); + set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h index ff45286cd9a..9beb6f6427e 100644 --- a/gdb/linux-tdep.h +++ b/gdb/linux-tdep.h @@ -29,8 +29,6 @@ typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *, bfd *, char *, int *, enum gdb_signal); -struct type *linux_get_siginfo_type (struct gdbarch *); - extern enum gdb_signal linux_gdb_signal_from_target (struct gdbarch *gdbarch, int signal); diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c index 03de4ea596d..c60a879dfb8 100644 --- a/gdb/m68klinux-tdep.c +++ b/gdb/m68klinux-tdep.c @@ -422,8 +422,6 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); - - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 3849ca665c9..4bdd13e2b0b 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1801,8 +1801,6 @@ ppc_linux_init_abi (struct gdbarch_info info, set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location); - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); - /* Support reverse debugging. */ set_gdbarch_process_record (gdbarch, ppc_process_record); set_gdbarch_process_record_signal (gdbarch, ppc_linux_record_signal); diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c index 0650c276b74..2460aa1d404 100644 --- a/gdb/s390-linux-tdep.c +++ b/gdb/s390-linux-tdep.c @@ -3329,8 +3329,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); - /* SystemTap functions. */ set_gdbarch_stap_register_prefixes (gdbarch, stap_register_prefixes); set_gdbarch_stap_register_indirection_prefixes (gdbarch, diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c209fe6b4e5..8825f4c8c22 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-24 Yao Qi + + * lib/gdb.exp (supports_get_siginfo_type): Return 1 for all + linux targets. + 2015-06-24 Yao Qi * lib/gdb.exp (supports_get_siginfo_type): New proc. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 761f7d13c48..c0e0cb1b09b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2000,9 +2000,7 @@ gdb_caching_proc support_complex_tests { # return 0. proc supports_get_siginfo_type {} { - if { [istarget "i?86-*-linux*"] - || [istarget "x86_64-*-linux*"] - || [istarget "arm*-*-linux*"] } { + if { [istarget "*-*-linux*"] } { return 1 } else { return 0 diff --git a/gdb/tilegx-linux-tdep.c b/gdb/tilegx-linux-tdep.c index 2de86e53f52..b3e34fe4753 100644 --- a/gdb/tilegx-linux-tdep.c +++ b/gdb/tilegx-linux-tdep.c @@ -133,8 +133,6 @@ tilegx_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); - - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); } /* Provide a prototype to silence -Wmissing-prototypes. */ -- 2.30.2