* [PATCH 1/2] New proc supports_get_siginfo_type
@ 2015-06-22 11:03 Yao Qi
2015-06-22 11:03 ` [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type Yao Qi
2015-06-24 10:32 ` [PATCH 1/2] New proc supports_get_siginfo_type Pedro Alves
0 siblings, 2 replies; 7+ messages in thread
From: Yao Qi @ 2015-06-22 11:03 UTC (permalink / raw)
To: gdb-patches
Both siginfo-obj.exp and siginfo-thread.exp have the same code
checking the support of geting a type of siginfo for a given arch.
This patch is to move these code into a proc supports_get_siginfo_type.
gdb/testsuite:
2015-06-22 Yao Qi <yao.qi@linaro.org>
* lib/gdb.exp (supports_get_siginfo_type): New proc.
* gdb.base/siginfo-obj.exp: Invoke supports_get_siginfo_type.
* gdb.base/siginfo-thread.exp: Likewise.
---
gdb/testsuite/gdb.base/siginfo-obj.exp | 4 +---
gdb/testsuite/gdb.base/siginfo-thread.exp | 4 +---
gdb/testsuite/lib/gdb.exp | 13 +++++++++++++
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp
index 0d1b96d..578c12e 100644
--- a/gdb/testsuite/gdb.base/siginfo-obj.exp
+++ b/gdb/testsuite/gdb.base/siginfo-obj.exp
@@ -26,9 +26,7 @@ if [target_info exists gdb,nosignals] {
continue
}
-if { ! [istarget "i?86-*-linux*"]
- && ! [istarget "x86_64-*-linux*"]
- && ! [istarget "arm*-*-linux*"] } {
+if { ![supports_get_siginfo_type] } {
verbose "Skipping siginfo-obj.exp because of lack of support."
return
}
diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp
index 638bef3..a00b5aa 100644
--- a/gdb/testsuite/gdb.base/siginfo-thread.exp
+++ b/gdb/testsuite/gdb.base/siginfo-thread.exp
@@ -21,9 +21,7 @@ if [target_info exists gdb,nosignals] {
continue
}
-if { ! [istarget "i?86-*-linux*"]
- && ! [istarget "x86_64-*-linux*"]
- && ! [istarget "arm*-*-linux*"] } {
+if { ![supports_get_siginfo_type] } {
verbose "Skipping siginfo-thread.exp because of lack of support."
return
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d169f3d..d3ed56f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1996,6 +1996,19 @@ gdb_caching_proc support_complex_tests {
return $result
}
+# Return 1 if GDB can get a type for siginfo from the target, otherwise
+# return 0.
+
+proc supports_get_siginfo_type {} {
+ if { [istarget "i?86-*-linux*"]
+ || [istarget "x86_64-*-linux*"]
+ || [istarget "arm*-*-linux*"] } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
# Return 1 if target hardware or OS supports single stepping to signal
# handler, otherwise, return 0.
--
1.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type
2015-06-22 11:03 [PATCH 1/2] New proc supports_get_siginfo_type Yao Qi
@ 2015-06-22 11:03 ` Yao Qi
2015-06-24 10:45 ` Pedro Alves
2015-06-24 10:32 ` [PATCH 1/2] New proc supports_get_siginfo_type Pedro Alves
1 sibling, 1 reply; 7+ messages in thread
From: Yao Qi @ 2015-06-22 11:03 UTC (permalink / raw)
To: gdb-patches
gdbarch method get_siginfo_type is implemented on aaarch64-linux, so
supports_get_siginfo_type should return 1 on aaarch64-linux.
gdb/testsuite:
2015-06-22 Yao Qi <yao.qi@linaro.org>
* lib/gdb.exp (supports_get_siginfo_type): Add aarch64-linux.
---
gdb/testsuite/lib/gdb.exp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d3ed56f..47221cb 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2002,7 +2002,8 @@ gdb_caching_proc support_complex_tests {
proc supports_get_siginfo_type {} {
if { [istarget "i?86-*-linux*"]
|| [istarget "x86_64-*-linux*"]
- || [istarget "arm*-*-linux*"] } {
+ || [istarget "arm*-*-linux*"]
+ || [istarget "aarch64*-*-linux*"] } {
return 1
} else {
return 0
--
1.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] New proc supports_get_siginfo_type
2015-06-22 11:03 [PATCH 1/2] New proc supports_get_siginfo_type Yao Qi
2015-06-22 11:03 ` [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type Yao Qi
@ 2015-06-24 10:32 ` Pedro Alves
2015-06-24 13:57 ` Yao Qi
1 sibling, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2015-06-24 10:32 UTC (permalink / raw)
To: Yao Qi, gdb-patches
On 06/22/2015 12:03 PM, Yao Qi wrote:
> Both siginfo-obj.exp and siginfo-thread.exp have the same code
> checking the support of geting a type of siginfo for a given arch.
> This patch is to move these code into a proc supports_get_siginfo_type.
Looks fine to me.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type
2015-06-22 11:03 ` [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type Yao Qi
@ 2015-06-24 10:45 ` Pedro Alves
2015-06-24 13:31 ` Yao Qi
0 siblings, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2015-06-24 10:45 UTC (permalink / raw)
To: Yao Qi, gdb-patches
On 06/22/2015 12:03 PM, Yao Qi wrote:
> gdbarch method get_siginfo_type is implemented on aaarch64-linux, so
> supports_get_siginfo_type should return 1 on aaarch64-linux.
typo: aaarch64.
(Patch looks obvious to me.)
I note that a few other archs are also missing here:
aarch64-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
amd64-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
arm-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
i386-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
m68klinux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
ppc-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
s390-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
tilegx-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
though at the pace this is taking, it'd probably be better to register
linux_get_siginfo_type as default for all Linux archs (in linux-tdep.c:linux_init_abi),
and have archs whoch kernel/ABI uses the non-generic siginfo layout install a
custom get_siginfo_type version. The supports_get_siginfo_type testsuite function
would then return true for [istarget "*-*-linux*"]. The testsuite would then help
show which archs would those be.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type
2015-06-24 10:45 ` Pedro Alves
@ 2015-06-24 13:31 ` Yao Qi
2015-06-24 13:39 ` Pedro Alves
0 siblings, 1 reply; 7+ messages in thread
From: Yao Qi @ 2015-06-24 13:31 UTC (permalink / raw)
To: Pedro Alves; +Cc: Yao Qi, gdb-patches
Pedro Alves <palves@redhat.com> writes:
> I note that a few other archs are also missing here:
>
> aarch64-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> amd64-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> arm-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> i386-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> m68klinux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> ppc-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> s390-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
> tilegx-linux-tdep.c: set_gdbarch_get_siginfo_type (gdbarch,
> linux_get_siginfo_type);
Hmm, looks something wrong in my emacs+cscope that only the top four are
shown up.
>
> though at the pace this is taking, it'd probably be better to register
> linux_get_siginfo_type as default for all Linux archs (in
> linux-tdep.c:linux_init_abi),
> and have archs whoch kernel/ABI uses the non-generic siginfo layout install a
> custom get_siginfo_type version. The supports_get_siginfo_type
> testsuite function
> would then return true for [istarget "*-*-linux*"]. The testsuite
> would then help
> show which archs would those be.
Change like this may cause some fails for some linux targets which need
their custom get_siginfo_type implementations. Here is a patch below,
I rerun siginfo-obj.exp and siginfo-thread.exp on aarch64/arm/x86_64 linux.
--
Yao (齐尧)
From 476653a2990b4ebfac806b0da6ffa24b5672ece9 Mon Sep 17 00:00:00 2001
From: Yao Qi <yao.qi@linaro.org>
Date: Fri, 19 Jun 2015 14:50:33 +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 <yao.qi@linaro.org>
* 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 <yao.qi@linaro.org>
* lib/gdb.exp (supports_get_siginfo_type): Return 1 for all
linux targets.
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 2f93846..f8cf43e 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 2a8de82..e9be9cf 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 fc013ce..d79948e 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1441,8 +1441,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 061ad3a..283ba40 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -996,8 +996,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 c81f71b..ff3ada7 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 ff45286..9beb6f6 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 03de4ea..c60a879 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 3849ca6..4bdd13e 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 0650c27..2460aa1 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/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index cc50866..0656a0c 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 2de86e5..b3e34fe 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. */
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type
2015-06-24 13:31 ` Yao Qi
@ 2015-06-24 13:39 ` Pedro Alves
0 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2015-06-24 13:39 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On 06/24/2015 02:30 PM, Yao Qi wrote:
>>
>> though at the pace this is taking, it'd probably be better to register
>> linux_get_siginfo_type as default for all Linux archs (in
>> linux-tdep.c:linux_init_abi),
>> and have archs whoch kernel/ABI uses the non-generic siginfo layout install a
>> custom get_siginfo_type version. The supports_get_siginfo_type
>> testsuite function
>> would then return true for [istarget "*-*-linux*"]. The testsuite
>> would then help
>> show which archs would those be.
>
> Change like this may cause some fails for some linux targets which need
> their custom get_siginfo_type implementations.
Right, that's how I was thinking the tests would help. As is currently,
arch maintainers miss that the feature even exists.
> Here is a patch below,
> I rerun siginfo-obj.exp and siginfo-thread.exp on aarch64/arm/x86_64 linux.
Thanks.
> From 476653a2990b4ebfac806b0da6ffa24b5672ece9 Mon Sep 17 00:00:00 2001
> From: Yao Qi <yao.qi@linaro.org>
> Date: Fri, 19 Jun 2015 14:50:33 +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.
(Or if you need a quick fix, set it to NULL in that particular arch's
gdbarch init function.)
Looks good to me. Thanks for doing this.
--
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] New proc supports_get_siginfo_type
2015-06-24 10:32 ` [PATCH 1/2] New proc supports_get_siginfo_type Pedro Alves
@ 2015-06-24 13:57 ` Yao Qi
0 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2015-06-24 13:57 UTC (permalink / raw)
To: Pedro Alves, gdb-patches
On 24/06/15 11:32, Pedro Alves wrote:
> Looks fine to me.
I've pushed these two patches in.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-06-24 13:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22 11:03 [PATCH 1/2] New proc supports_get_siginfo_type Yao Qi
2015-06-22 11:03 ` [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type Yao Qi
2015-06-24 10:45 ` Pedro Alves
2015-06-24 13:31 ` Yao Qi
2015-06-24 13:39 ` Pedro Alves
2015-06-24 10:32 ` [PATCH 1/2] New proc supports_get_siginfo_type Pedro Alves
2015-06-24 13:57 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox