* [PATCH 15/17] SPARC support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (4 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 08/17] h8300 support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 09/17] i386 support Sergio Durigan Junior
` (14 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for SPARC. It does not share some signal numbers, therefore
there is the target-specific implementation for them.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* sparc-linux-tdep.c: Define enum with differences between SPARC
and x86 signal numbers.
(sparc32_linux_gdb_signal_to_target): New function.
(sparc32_linux_init_abi): Set gdbarch_gdb_signal_to_target to
sparc32_linux_gdb_signal_to_target.
---
gdb/sparc-linux-tdep.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index 02c4137..6d33b28 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -90,6 +90,31 @@ static const struct tramp_frame sparc32_linux_rt_sigframe =
sparc32_linux_sigframe_init
};
+/* This enum represents the signals' numbers on the SPARC
+ architecture. It just contains the signal definitions which are
+ different from x86.
+
+ It is derived from the file <arch/sparc/include/uapi/asm/signal.h>,
+ from the Linux kernel tree. */
+
+enum
+ {
+ SPARC_LINUX_SIGEMT = 7,
+ SPARC_LINUX_SIGBUS = 10,
+ SPARC_LINUX_SIGSYS = 12,
+ SPARC_LINUX_SIGURG = 16,
+ SPARC_LINUX_SIGSTOP = 17,
+ SPARC_LINUX_SIGTSTP = 18,
+ SPARC_LINUX_SIGCONT = 19,
+ SPARC_LINUX_SIGCHLD = 20,
+ SPARC_LINUX_SIGIO = 23,
+ SPARC_LINUX_SIGPOLL = SPARC_LINUX_SIGIO,
+ SPARC_LINUX_SIGLOST = 29,
+ SPARC_LINUX_SIGPWR = SPARC_LINUX_SIGLOST,
+ SPARC_LINUX_SIGUSR1 = 30,
+ SPARC_LINUX_SIGUSR2 = 31,
+ };
+
static void
sparc32_linux_sigframe_init (const struct tramp_frame *self,
struct frame_info *this_frame,
@@ -268,6 +293,61 @@ sparc32_linux_get_syscall_number (struct gdbarch *gdbarch,
return ret;
}
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. */
+
+static int
+sparc32_linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ case GDB_SIGNAL_EMT:
+ return SPARC_LINUX_SIGEMT;
+
+ case GDB_SIGNAL_BUS:
+ return SPARC_LINUX_SIGBUS;
+
+ case GDB_SIGNAL_SYS:
+ return SPARC_LINUX_SIGSYS;
+
+ case GDB_SIGNAL_URG:
+ return SPARC_LINUX_SIGURG;
+
+ case GDB_SIGNAL_STOP:
+ return SPARC_LINUX_SIGSTOP;
+
+ case GDB_SIGNAL_TSTP:
+ return SPARC_LINUX_SIGTSTP;
+
+ case GDB_SIGNAL_CONT:
+ return SPARC_LINUX_SIGCONT;
+
+ case GDB_SIGNAL_CHLD:
+ return SPARC_LINUX_SIGCHLD;
+
+ case GDB_SIGNAL_IO:
+ return SPARC_LINUX_SIGIO;
+
+ case GDB_SIGNAL_POLL:
+ return SPARC_LINUX_SIGPOLL;
+
+ case GDB_SIGNAL_LOST:
+ return SPARC_LINUX_SIGLOST;
+
+ case GDB_SIGNAL_PWR:
+ return SPARC_LINUX_SIGPWR;
+
+ case GDB_SIGNAL_USR1:
+ return SPARC_LINUX_SIGUSR1;
+
+ case GDB_SIGNAL_USR2:
+ return SPARC_LINUX_SIGUSR2;
+ }
+
+ return linux_gdb_signal_to_target (gdbarch, signal);
+}
+
\f
static void
@@ -313,6 +393,9 @@ sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_xml_syscall_file_name (XML_SYSCALL_FILENAME_SPARC32);
set_gdbarch_get_syscall_number (gdbarch,
sparc32_linux_get_syscall_number);
+
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ sparc32_linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 02/17] Linux kernel generic support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (2 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 10/17] IA-64 support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 10:57 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 08/17] h8300 support Sergio Durigan Junior
` (16 subsequent siblings)
20 siblings, 1 reply; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
This is, along with the gdbarch changes, the main patch of this series.
It implements the generic converter between GDB's internal signals and
x86 ones.
It defines the full enum containing all x86 signals (as defined in
arch/x86/include/uapi/asm/signal.h, on the Linux kernel), and the
"generic" linux_gdb_signal_to_target, which is then exported to all
-tdep files. This function will be used when (a) the target shares all
the signal numbers with x86 (thus, it is totally x86-compatible), or (b)
when the target shares some signal numbers with x86. In the latter
case, the target is responsible for converting the different signals.
I have chosen x86 as the main source because it seems the de facto
implementation, and because it was easier for me.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* linux-tdep.c: Define enum with x86 signal numbers.
(linux_gdb_signal_to_target): New function.
* linux-tdep.h (linux_gdb_signal_to_target): New prototype.
---
gdb/linux-tdep.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
gdb/linux-tdep.h | 3 +
2 files changed, 185 insertions(+)
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index bfb6404..ecdba85 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -36,6 +36,60 @@
#include <ctype.h>
+/* This enum represents the signals' numbers on a generic architecture
+ running the Linux kernel. By "generic" we actually mean
+ "x86-compatible", since most architectures supported by this kernel
+ borrow the signals' numbers from x86.
+
+ For those architectures which are not compatible with x86 signals (e.g.,
+ Alpha), we define the different signals (and *only* those) in the specific
+ target-dependent file (e.g., alpha-linux-tdep.c, for Alpha). Please refer
+ to the architecture's tdep file for more information.
+
+ This enum is derived from the file
+ <arch/x86/include/uapi/asm/signal.h>, from the Linux kernel tree. */
+
+enum
+ {
+ LINUX_SIGHUP = 1,
+ LINUX_SIGINT = 2,
+ LINUX_SIGQUIT = 3,
+ LINUX_SIGILL = 4,
+ LINUX_SIGTRAP = 5,
+ LINUX_SIGABRT = 6,
+ LINUX_SIGIOT = 6,
+ LINUX_SIGBUS = 7,
+ LINUX_SIGFPE = 8,
+ LINUX_SIGKILL = 9,
+ LINUX_SIGUSR1 = 10,
+ LINUX_SIGSEGV = 11,
+ LINUX_SIGUSR2 = 12,
+ LINUX_SIGPIPE = 13,
+ LINUX_SIGALRM = 14,
+ LINUX_SIGTERM = 15,
+ LINUX_SIGSTKFLT = 16,
+ LINUX_SIGCHLD = 17,
+ LINUX_SIGCONT = 18,
+ LINUX_SIGSTOP = 19,
+ LINUX_SIGTSTP = 20,
+ LINUX_SIGTTIN = 21,
+ LINUX_SIGTTOU = 22,
+ LINUX_SIGURG = 23,
+ LINUX_SIGXCPU = 24,
+ LINUX_SIGXFSZ = 25,
+ LINUX_SIGVTALRM = 26,
+ LINUX_SIGPROF = 27,
+ LINUX_SIGWINCH = 28,
+ LINUX_SIGIO = 29,
+ LINUX_SIGPOLL = LINUX_SIGIO,
+ LINUX_SIGPWR = 30,
+ LINUX_SIGSYS = 31,
+ LINUX_SIGUNUSED = 31,
+
+ LINUX_SIGRTMIN = 32,
+ LINUX_SIGRTMAX = 64,
+ };
+
static struct gdbarch_data *linux_gdbarch_data_handle;
struct linux_gdbarch_data
@@ -1447,6 +1501,134 @@ linux_make_corefile_notes_1 (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
linux_collect_thread_registers);
}
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. This function is not static because it is exported to
+ other -tdep files. */
+
+int
+linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ case GDB_SIGNAL_0:
+ return 0;
+
+ case GDB_SIGNAL_HUP:
+ return LINUX_SIGHUP;
+
+ case GDB_SIGNAL_INT:
+ return LINUX_SIGINT;
+
+ case GDB_SIGNAL_QUIT:
+ return LINUX_SIGQUIT;
+
+ case GDB_SIGNAL_ILL:
+ return LINUX_SIGILL;
+
+ case GDB_SIGNAL_TRAP:
+ return LINUX_SIGTRAP;
+
+ case GDB_SIGNAL_ABRT:
+ return LINUX_SIGABRT;
+
+ case GDB_SIGNAL_FPE:
+ return LINUX_SIGFPE;
+
+ case GDB_SIGNAL_KILL:
+ return LINUX_SIGKILL;
+
+ case GDB_SIGNAL_BUS:
+ return LINUX_SIGBUS;
+
+ case GDB_SIGNAL_SEGV:
+ return LINUX_SIGSEGV;
+
+ case GDB_SIGNAL_SYS:
+ return LINUX_SIGSYS;
+
+ case GDB_SIGNAL_PIPE:
+ return LINUX_SIGPIPE;
+
+ case GDB_SIGNAL_ALRM:
+ return LINUX_SIGALRM;
+
+ case GDB_SIGNAL_TERM:
+ return LINUX_SIGTERM;
+
+ case GDB_SIGNAL_URG:
+ return LINUX_SIGURG;
+
+ case GDB_SIGNAL_STOP:
+ return LINUX_SIGSTOP;
+
+ case GDB_SIGNAL_TSTP:
+ return LINUX_SIGTSTP;
+
+ case GDB_SIGNAL_CONT:
+ return LINUX_SIGCONT;
+
+ case GDB_SIGNAL_CHLD:
+ return LINUX_SIGCHLD;
+
+ case GDB_SIGNAL_TTIN:
+ return LINUX_SIGTTIN;
+
+ case GDB_SIGNAL_TTOU:
+ return LINUX_SIGTTOU;
+
+ case GDB_SIGNAL_IO:
+ return LINUX_SIGIO;
+
+ case GDB_SIGNAL_XCPU:
+ return LINUX_SIGXCPU;
+
+ case GDB_SIGNAL_XFSZ:
+ return LINUX_SIGXFSZ;
+
+ case GDB_SIGNAL_VTALRM:
+ return LINUX_SIGVTALRM;
+
+ case GDB_SIGNAL_PROF:
+ return LINUX_SIGPROF;
+
+ case GDB_SIGNAL_WINCH:
+ return LINUX_SIGWINCH;
+
+ case GDB_SIGNAL_USR1:
+ return LINUX_SIGUSR1;
+
+ case GDB_SIGNAL_USR2:
+ return LINUX_SIGUSR2;
+
+ case GDB_SIGNAL_PWR:
+ return LINUX_SIGPWR;
+
+ case GDB_SIGNAL_POLL:
+ return LINUX_SIGPOLL;
+
+ /* GDB_SIGNAL_REALTIME_32 is not continuous in <gdb/signals.def>,
+ therefore we have to handle it here. */
+ case GDB_SIGNAL_REALTIME_32:
+ return LINUX_SIGRTMIN;
+
+ /* Same comment applies to _64. */
+ case GDB_SIGNAL_REALTIME_64:
+ return LINUX_SIGRTMAX;
+ }
+
+ /* GDB_SIGNAL_REALTIME_33 to _64 are continuous. */
+ if (signal >= GDB_SIGNAL_REALTIME_33
+ && signal <= GDB_SIGNAL_REALTIME_63)
+ {
+ int offset = signal - GDB_SIGNAL_REALTIME_33;
+
+ return LINUX_SIGRTMIN + 1 + offset;
+ }
+
+ return -1;
+}
+
/* To be called from the various GDB_OSABI_LINUX handlers for the
various GNU/Linux architectures and machine types. */
diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h
index 380507e..c1d80de 100644
--- a/gdb/linux-tdep.h
+++ b/gdb/linux-tdep.h
@@ -34,6 +34,9 @@ char *linux_make_corefile_notes (struct gdbarch *, bfd *, int *,
struct type *linux_get_siginfo_type (struct gdbarch *);
+extern int linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal);
+
extern void linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
#endif /* linux-tdep.h */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 08/17] h8300 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (3 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 02/17] Linux kernel generic support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 15/17] SPARC support Sergio Durigan Junior
` (15 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for the h8300 architecture. Trivial; it shares the signal
numbers with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* h8300-tdep.c: Include linux-tdep.h.
(h8300_gdbarch_init): Set gdbarch_gdb_signal_to_target
to linux_gdb_signal_to_target.
---
gdb/h8300-tdep.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 0e9d6c4..7ace0ca 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -33,6 +33,7 @@
#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "linux-tdep.h"
enum gdb_regnum
{
@@ -1357,6 +1358,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
dwarf2_append_unwinders (gdbarch);
frame_unwind_append_unwinder (gdbarch, &h8300_frame_unwind);
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ linux_gdb_signal_to_target);
+
return gdbarch;
}
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 10/17] IA-64 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 11/17] m32r support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 05/17] ARM support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 02/17] Linux kernel generic support Sergio Durigan Junior
` (17 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
IA-64 target support. Trivial, shares the signal numbers with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* ia64-linux-tdep.c (ia64_linux_init_abi): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/ia64-linux-tdep.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c
index d1eb529..d1eb29f 100644
--- a/gdb/ia64-linux-tdep.c
+++ b/gdb/ia64-linux-tdep.c
@@ -163,6 +163,8 @@ ia64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_stap_gdb_register_prefix (gdbarch, "r");
set_gdbarch_stap_is_single_operand (gdbarch,
ia64_linux_stap_is_single_operand);
+
+ set_gdbarch_gdb_signal_to_target (gdbarch, linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 04/17] x86_64 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (14 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 07/17] Cris support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-17 17:16 ` Tom Tromey
2013-07-01 7:43 ` [PATCH 06/17] AVR support Sergio Durigan Junior
` (4 subsequent siblings)
20 siblings, 1 reply; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
This patch simply adds support for x86_64 targets. In this particular
case, we just have to set linux_gdb_signal_to_target as the default
gdbarch method.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* amd64-linux-tdep.c (amd64_linux_init_abi_common): Set
gdbarch_gdb_signal_to_target as linux_gdb_signal_to_target.
---
gdb/amd64-linux-tdep.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 88c291d..cf999ec 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1326,6 +1326,11 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_get_syscall_number (gdbarch,
amd64_linux_get_syscall_number);
+ /* Convert the internal GDB signal representation to the
+ target's. */
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ linux_gdb_signal_to_target);
+
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 07/17] Cris support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (13 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 16/17] Xtensa support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 04/17] x86_64 support Sergio Durigan Junior
` (5 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Cris target support. Trivial, since it shares the signal numbers with
x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* cris-tdep.c: Include linux-tdep.h.
(cris_gdbarch_init): Set gdbarch_gdb_signal_to_target to
linux_gdb_signal_to_target.
---
gdb/cris-tdep.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 03041e4..1d78ded 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -44,6 +44,7 @@
#include "solib-svr4.h"
#include "gdb_string.h"
#include "dis-asm.h"
+#include "linux-tdep.h"
enum cris_num_regs
{
@@ -4178,7 +4179,9 @@ cris_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_gdbarch_gdb_signal_to_target (gdbarch, linux_gdb_signal_to_target);
+
/* FIXME: cagney/2003-08-27: It should be possible to select a CRIS
disassembler, even when there is no BFD. Does something like
"gdb; target remote; disassmeble *0x123" work? */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 05/17] ARM support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 11/17] m32r support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-17 17:20 ` Tom Tromey
2013-07-01 7:43 ` [PATCH 10/17] IA-64 support Sergio Durigan Junior
` (18 subsequent siblings)
20 siblings, 1 reply; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for the ARM target. Even though ARM shares almost everything
with x86 regarding signal numbers, there is SIGSWI which is an ARM-only
signal as far as I have verified. However, GDB's internal signal
definition does not recognize SIGSWI, so there is nothing we can/must
do.
Therefore, I have chosen to define the target-specific enum anyway,
even though we end up using the generic Linux function to translate to
the target's signal representation.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* arm-linux-tdep.c: Define enum with differences between ARM and
x86 signals.
(arm_linux_init_abi): Set gdbarch_gdb_signal_to_target to
linux_gdb_signal_to_target.
---
gdb/arm-linux-tdep.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 1502bdc..f580d1e 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -250,6 +250,18 @@ static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa
#define ARM_LDR_PC_SP_12 0xe49df00c
#define ARM_LDR_PC_SP_4 0xe49df004
+/* This enum represents the signals' numbers on the ARM
+ architecture. It just contains the signal definitions which are
+ different from x86.
+
+ It is derived from the file <arch/arm/include/uapi/asm/signal.h>,
+ from the Linux kernel tree. */
+
+enum
+ {
+ ARM_LINUX_SIGSWI = 32,
+ };
+
static void
arm_linux_sigtramp_cache (struct frame_info *this_frame,
struct trad_frame_cache *this_cache,
@@ -1292,6 +1304,8 @@ arm_linux_init_abi (struct gdbarch_info info,
set_gdbarch_stap_parse_special_token (gdbarch,
arm_stap_parse_special_token);
+ set_gdbarch_gdb_signal_to_target (gdbarch, linux_gdb_signal_to_target);
+
tdep->syscall_next_pc = arm_linux_syscall_next_pc;
/* Syscall record. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 03/17] Alpha support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (8 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 13/17] mn10300 support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 01/17] Implement the gdbarch.{sh,c,h} bits Sergio Durigan Junior
` (10 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
This patch implements the support for the Alpha architecture. Since
this arch has some differences from x86, it basically defines an enum
with those different signals, which is later used by
alpha_linux_gdb_signal_to_target to return the proper signal number.
The common signals between x86 and Alpha are treated on the generic
linux_gdb_signal_to_target.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* alpha-linux-tdep.c: Define new enum with signals different
from x86.
(alpha_linux_gdb_signal_to_target): New function.
(alpha_linux_init_abi): Set gdbarch_gdb_signal_to_target as
alpha_linux_gdb_signal_to_target.
---
gdb/alpha-linux-tdep.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
index 9efc5bd..1f36218 100644
--- a/gdb/alpha-linux-tdep.c
+++ b/gdb/alpha-linux-tdep.c
@@ -28,6 +28,35 @@
#include "linux-tdep.h"
#include "alpha-tdep.h"
+/* This enum represents the signals' numbers on the Alpha
+ architecture. It just contains the signal definitions which are
+ different from x86.
+
+ It is derived from the file <arch/alpha/include/uapi/asm/signal.h>,
+ from the Linux kernel tree. */
+
+enum
+ {
+ /* SIGABRT is the same as in x86, but is defined here because
+ SIGIOT depends on it. */
+ ALPHA_LINUX_SIGABRT = 6,
+ ALPHA_LINUX_SIGEMT = 7,
+ ALPHA_LINUX_SIGBUS = 10,
+ ALPHA_LINUX_SIGSYS = 12,
+ ALPHA_LINUX_SIGURG = 16,
+ ALPHA_LINUX_SIGSTOP = 17,
+ ALPHA_LINUX_SIGTSTP = 18,
+ ALPHA_LINUX_SIGCONT = 19,
+ ALPHA_LINUX_SIGCHLD = 20,
+ ALPHA_LINUX_SIGIO = 23,
+ ALPHA_LINUX_SIGINFO = 29,
+ ALPHA_LINUX_SIGUSR1 = 30,
+ ALPHA_LINUX_SIGUSR2 = 31,
+ ALPHA_LINUX_SIGPOLL = ALPHA_LINUX_SIGIO,
+ ALPHA_LINUX_SIGPWR = ALPHA_LINUX_SIGINFO,
+ ALPHA_LINUX_SIGIOT = ALPHA_LINUX_SIGABRT,
+ };
+
/* Under GNU/Linux, signal handler invocations can be identified by
the designated code sequence that is used to return from a signal
handler. In particular, the return address of a signal handler
@@ -205,6 +234,63 @@ alpha_linux_regset_from_core_section (struct gdbarch *gdbarch,
return NULL;
}
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. */
+
+static int
+alpha_linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ case GDB_SIGNAL_EMT:
+ return ALPHA_LINUX_SIGEMT;
+
+ case GDB_SIGNAL_BUS:
+ return ALPHA_LINUX_SIGBUS;
+
+ case GDB_SIGNAL_SYS:
+ return ALPHA_LINUX_SIGSYS;
+
+ case GDB_SIGNAL_URG:
+ return ALPHA_LINUX_SIGURG;
+
+ case GDB_SIGNAL_STOP:
+ return ALPHA_LINUX_SIGSTOP;
+
+ case GDB_SIGNAL_TSTP:
+ return ALPHA_LINUX_SIGTSTP;
+
+ case GDB_SIGNAL_CONT:
+ return ALPHA_LINUX_SIGCONT;
+
+ case GDB_SIGNAL_CHLD:
+ return ALPHA_LINUX_SIGCHLD;
+
+ case GDB_SIGNAL_IO:
+ return ALPHA_LINUX_SIGIO;
+
+ case GDB_SIGNAL_INFO:
+ return ALPHA_LINUX_SIGINFO;
+
+ case GDB_SIGNAL_USR1:
+ return ALPHA_LINUX_SIGUSR1;
+
+ case GDB_SIGNAL_USR2:
+ return ALPHA_LINUX_SIGUSR2;
+
+ case GDB_SIGNAL_POLL:
+ return ALPHA_LINUX_SIGPOLL;
+
+ case GDB_SIGNAL_PWR:
+ return ALPHA_LINUX_SIGPWR;
+ }
+
+ /* We covered the different signals, the remaining ones are equal
+ for x86. */
+ return linux_gdb_signal_to_target (gdbarch, signal);
+}
+
static void
alpha_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -236,6 +322,9 @@ alpha_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_regset_from_core_section
(gdbarch, alpha_linux_regset_from_core_section);
+
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ alpha_linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 12/17] m68klinux support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (10 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 01/17] Implement the gdbarch.{sh,c,h} bits Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 17/17] MIPS support Sergio Durigan Junior
` (8 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for m68klinux. Trivial because the target shares the signal
numbers with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* m68klinux-tdep.c (m68k_linux_init_abi): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/m68klinux-tdep.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c
index be90885..86b15b3 100644
--- a/gdb/m68klinux-tdep.c
+++ b/gdb/m68klinux-tdep.c
@@ -372,6 +372,9 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
svr4_fetch_objfile_link_map);
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
+
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 06/17] AVR support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (15 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 04/17] x86_64 support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 8:43 ` [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Andreas Schwab
` (3 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for the AVR architecture. More of the same. Defining an enum
containing the differences between x86 and AVR signals, and treat them
on avr_linux_gdb_signal_to_target. In this case, the only difference is
the SIGRTMAX.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* avr-tdep.c: Define enum with differences between x86 and AVR
signals.
(avr_linux_gdb_signal_to_target): New function.
(avr_gdbarch_init): Set gdbarch_gdb_signal_to_target to
avr_linux_gdb_signal_to_target.
---
gdb/avr-tdep.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 0bc08a8..af02781 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -36,6 +36,7 @@
#include "regcache.h"
#include "gdb_string.h"
#include "dis-asm.h"
+#include "linux-tdep.h"
/* AVR Background:
@@ -193,6 +194,19 @@ struct gdbarch_tdep
struct type *pc_type;
};
+/* This enum represents the signals' numbers on the AVR
+ architecture. It just contains the signal definitions which are
+ different from x86.
+
+ It is derived from the file <arch/avr32/include/uapi/asm/signal.h>,
+ from the Linux kernel tree. */
+
+enum
+ {
+ AVR_LINUX_SIGRTMIN = 32,
+ AVR_LINUX_SIGRTMAX = 63,
+ };
+
/* Lookup the name of a register given it's number. */
static const char *
@@ -1344,6 +1358,39 @@ avr_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
return -1;
}
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. */
+
+static int
+avr_linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ /* GDB_SIGNAL_REALTIME_32 is not continuous in <gdb/signals.def>,
+ therefore we have to handle it here. */
+ case GDB_SIGNAL_REALTIME_32:
+ return AVR_LINUX_SIGRTMIN;
+
+ /* GDB_SIGNAL_REALTIME_64 is not valid on AVR. */
+ case GDB_SIGNAL_REALTIME_64:
+ return -1;
+ }
+
+ /* GDB_SIGNAL_REALTIME_33 to _63 are continuous.
+
+ AVR does not have _64. */
+ if (signal >= GDB_SIGNAL_REALTIME_33
+ && signal <= GDB_SIGNAL_REALTIME_63)
+ {
+ int offset = signal - GDB_SIGNAL_REALTIME_33;
+
+ return AVR_LINUX_SIGRTMIN + 1 + offset;
+ }
+
+ return linux_gdb_signal_to_target (gdbarch, signal);
+}
+
/* Initialize the gdbarch structure for the AVR's. */
static struct gdbarch *
@@ -1447,6 +1494,9 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_unwind_pc (gdbarch, avr_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, avr_unwind_sp);
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ avr_linux_gdb_signal_to_target);
+
return gdbarch;
}
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 01/17] Implement the gdbarch.{sh,c,h} bits.
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (9 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 03/17] Alpha support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 12/17] m68klinux support Sergio Durigan Junior
` (9 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
This patch basically implements the necessary bits to the new
gdbarch_gdb_signal_to_target function.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* gdbarch.sh (gdb_signal_to_target): New function.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
---
gdb/gdbarch.c | 33 +++++++++++++++++++++++++++++++++
gdb/gdbarch.h | 14 ++++++++++++++
gdb/gdbarch.sh | 9 +++++++++
3 files changed, 56 insertions(+)
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index db35b40..1f3380e 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -261,6 +261,7 @@ struct gdbarch
gdbarch_process_record_ftype *process_record;
gdbarch_process_record_signal_ftype *process_record_signal;
gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target;
+ gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target;
gdbarch_get_siginfo_type_ftype *get_siginfo_type;
gdbarch_record_special_symbol_ftype *record_special_symbol;
gdbarch_get_syscall_number_ftype *get_syscall_number;
@@ -433,6 +434,7 @@ struct gdbarch startup_gdbarch =
0, /* process_record */
0, /* process_record_signal */
0, /* gdb_signal_from_target */
+ 0, /* gdb_signal_to_target */
0, /* get_siginfo_type */
0, /* record_special_symbol */
0, /* get_syscall_number */
@@ -738,6 +740,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of process_record, has predicate. */
/* Skip verify of process_record_signal, has predicate. */
/* Skip verify of gdb_signal_from_target, has predicate. */
+ /* Skip verify of gdb_signal_to_target, has predicate. */
/* Skip verify of get_siginfo_type, has predicate. */
/* Skip verify of record_special_symbol, has predicate. */
/* Skip verify of get_syscall_number, has predicate. */
@@ -1033,6 +1036,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: gdb_signal_from_target = <%s>\n",
host_address_to_string (gdbarch->gdb_signal_from_target));
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_gdb_signal_to_target_p() = %d\n",
+ gdbarch_gdb_signal_to_target_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdb_signal_to_target = <%s>\n",
+ host_address_to_string (gdbarch->gdb_signal_to_target));
+ fprintf_unfiltered (file,
"gdbarch_dump: gen_return_address = <%s>\n",
host_address_to_string (gdbarch->gen_return_address));
fprintf_unfiltered (file,
@@ -3900,6 +3909,30 @@ set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch,
}
int
+gdbarch_gdb_signal_to_target_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->gdb_signal_to_target != NULL;
+}
+
+int
+gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->gdb_signal_to_target != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_to_target called\n");
+ return gdbarch->gdb_signal_to_target (gdbarch, signal);
+}
+
+void
+set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch,
+ gdbarch_gdb_signal_to_target_ftype gdb_signal_to_target)
+{
+ gdbarch->gdb_signal_to_target = gdb_signal_to_target;
+}
+
+int
gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index e1959c3..013f071 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -993,6 +993,20 @@ typedef enum gdb_signal (gdbarch_gdb_signal_from_target_ftype) (struct gdbarch *
extern enum gdb_signal gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo);
extern void set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target);
+/* Signal translation: translate the GDB's internal signal number into
+ the inferior's signal (target's) representation. The implementation
+ of this method must be host independent. IOW, don't rely on symbols
+ of the NAT_FILE header (the nm-*.h files), the host <signal.h>
+ header, or similar headers.
+ Return the target signal number if found, or -1 if the GDB internal
+ signal number is invalid. */
+
+extern int gdbarch_gdb_signal_to_target_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_gdb_signal_to_target_ftype) (struct gdbarch *gdbarch, enum gdb_signal signal);
+extern int gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal);
+extern void set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target);
+
/* Extra signal info inspection.
Return a type suitable to inspect extra signal information. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index c92a857..04ca38c 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -799,6 +799,15 @@ M:int:process_record_signal:struct regcache *regcache, enum gdb_signal signal:re
# (target_wait, target_resume, etc.).
M:enum gdb_signal:gdb_signal_from_target:int signo:signo
+# Signal translation: translate the GDB's internal signal number into
+# the inferior's signal (target's) representation. The implementation
+# of this method must be host independent. IOW, don't rely on symbols
+# of the NAT_FILE header (the nm-*.h files), the host <signal.h>
+# header, or similar headers.
+# Return the target signal number if found, or -1 if the GDB internal
+# signal number is invalid.
+M:int:gdb_signal_to_target:enum gdb_signal signal:signal
+
# Extra signal info inspection.
#
# Return a type suitable to inspect extra signal information.
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 00/17] Implement gdbarch_gdb_signal_to_target
@ 2013-07-01 7:43 Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 11/17] m32r support Sergio Durigan Junior
` (20 more replies)
0 siblings, 21 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Hello,
This patch implements the new gdbarch method gdbarch_gdb_signal_to_target.
It will be used when one wants to convert between the internal GDB signal
representation (enum gdb_signal) and the target's representation.
The idea of this patch came from a chat between Pedro and I on IRC, plus
the discussion of my patches to add the new $_exitsignal convenience
variable:
<http://sourceware.org/ml/gdb-patches/2013-06/msg00452.html>
<http://sourceware.org/ml/gdb-patches/2013-06/msg00352.html>
What I did was to investigate, on the Linux kernel, which targets shared
the signal numbers definition with x86. My approach was to make the x86
the "de facto" implementation, and extend only the needed bits on each
arch. For the record, I used linux-3.10-rc6 as the main source of
information, always looking at
arch/<ARCH_NAME>/include/uapi/asm/signal.h. For SIGRTMAX (which defaults
to _NSIG in most cases), I had to look at different signal-related
files, but most of them (except MIPS) were defined to 64 anyway.
Then, with all the differences in hand, I implemented the bits on each
target. Since I obviously don't have access to all targets, I could not
compile GDB to make sure everything worked on each one of them, but I'd
be surprised if it didn't. I also am not submitting a testcase with
this patch because the gdbarch method is not being used anywhere yet; I
should send a proper testcase when I resubmit the $_exitsignal + $_signo
patches, because they will make use of the method.
I would appreciate if you could take a look and tell me your opinions.
Most of the patches are trivial, because they share all the signal
numbers with x86. If you want to narrow your review, I'd recommend
taking a look at the patches 01, 02, and 17 (MIPS, see the message +
patch for more explanations). Also, if you intend to test the
compilation of this patch on some architecture, you will need patches
01 and 02 to successfully compile it.
OK to apply? Comments are welcome.
Thanks.
--
Sergio
gdb/alpha-linux-tdep.c | 89 +++++++++++++++++++++++
gdb/amd64-linux-tdep.c | 5 ++
gdb/arm-linux-tdep.c | 14 ++++
gdb/avr-tdep.c | 50 +++++++++++++
gdb/cris-tdep.c | 5 +-
gdb/gdbarch.c | 33 +++++++++
gdb/gdbarch.h | 14 ++++
gdb/gdbarch.sh | 9 +++
gdb/h8300-tdep.c | 4 ++
gdb/i386-linux-tdep.c | 5 ++
gdb/ia64-linux-tdep.c | 2 +
gdb/linux-tdep.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++
gdb/linux-tdep.h | 3 +
gdb/m32r-linux-tdep.c | 2 +
gdb/m68klinux-tdep.c | 3 +
gdb/mips-linux-tdep.c | 132 ++++++++++++++++++++++++++++++++++
gdb/mn10300-linux-tdep.c | 2 +
gdb/s390-tdep.c | 2 +
gdb/sparc-linux-tdep.c | 83 +++++++++++++++++++++
gdb/xtensa-linux-tdep.c | 49 +++++++++++++
20 files changed, 687 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 13/17] mn10300 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (7 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 14/17] s390 support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 03/17] Alpha support Sergio Durigan Junior
` (11 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
This is the mn10300 target support. Again, trivial: it shares the
signal numbers with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* mn10300-linux-tdep.c (am33_linux_init_osabi): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/mn10300-linux-tdep.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
index 881af2b..95a72a6 100644
--- a/gdb/mn10300-linux-tdep.c
+++ b/gdb/mn10300-linux-tdep.c
@@ -720,6 +720,8 @@ am33_linux_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+ set_gdbarch_gdb_signal_to_target (gdbarch, linux_gdb_signal_to_target);
+
tramp_frame_prepend_unwinder (gdbarch, &am33_linux_sigframe);
tramp_frame_prepend_unwinder (gdbarch, &am33_linux_rt_sigframe);
}
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 11/17] m32r support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 05/17] ARM support Sergio Durigan Junior
` (19 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
This is the support for the m32r architecture. Trivial, because it
shares the signal numbers with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* m32r-linux-tdep.c (m32r_linux_init_abi): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/m32r-linux-tdep.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index 1994e92..973493f 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -427,6 +427,8 @@ m32r_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_gdb_signal_to_target (gdbarch, linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 16/17] Xtensa support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (12 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 17/17] MIPS support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 07/17] Cris support Sergio Durigan Junior
` (6 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Xtensa target support. It uses a different value for SIGRTMAX,
therefore we have to handle it here.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* xtensa-linux-tdep.c: Define enum with differences between
Xtensa and x86.
(xtensa_linux_gdb_signal_to_target): New function.
(xtensa_linux_init_abi): Set gdbarch_gdb_signal_to_target to
xtensa_linux_gdb_signal_to_target.
---
gdb/xtensa-linux-tdep.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/gdb/xtensa-linux-tdep.c b/gdb/xtensa-linux-tdep.c
index b7f11b9..3d1c356 100644
--- a/gdb/xtensa-linux-tdep.c
+++ b/gdb/xtensa-linux-tdep.c
@@ -23,6 +23,52 @@
#include "solib-svr4.h"
#include "symtab.h"
+/* This enum represents the signals' numbers on the Xtensa
+ architecture. It just contains the signal definitions which are
+ different from x86.
+
+ It is derived from the file <arch/xtensa/include/uapi/asm/signal.h>,
+ from the Linux kernel tree. */
+
+enum
+ {
+ XTENSA_LINUX_SIGRTMIN = 32,
+ XTENSA_LINUX_SIGRTMAX = 63,
+ };
+
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. */
+
+static int
+xtensa_linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ /* GDB_SIGNAL_REALTIME_32 is not continuous in <gdb/signals.def>,
+ therefore we have to handle it here. */
+ case GDB_SIGNAL_REALTIME_32:
+ return XTENSA_LINUX_SIGRTMIN;
+
+ /* GDB_SIGNAL_REALTIME_64 is not valid on Xtensa. */
+ case GDB_SIGNAL_REALTIME_64:
+ return -1;
+ }
+
+ /* GDB_SIGNAL_REALTIME_33 to _63 are continuous.
+
+ Xtensa does not have _64. */
+ if (signal >= GDB_SIGNAL_REALTIME_33
+ && signal <= GDB_SIGNAL_REALTIME_63)
+ {
+ int offset = signal - GDB_SIGNAL_REALTIME_33;
+
+ return XTENSA_LINUX_SIGRTMIN + 1 + offset;
+ }
+
+ return linux_gdb_signal_to_target (gdbarch, signal);
+}
+
/* OS specific initialization of gdbarch. */
static void
@@ -32,6 +78,9 @@ xtensa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ xtensa_linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 17/17] MIPS support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (11 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 12/17] m68klinux support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-17 17:59 ` Tom Tromey
2013-07-01 7:43 ` [PATCH 16/17] Xtensa support Sergio Durigan Junior
` (7 subsequent siblings)
20 siblings, 1 reply; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for the MIPS target. This is probably going to cause some
discussion/bikeshed.
MIPS already has a definition of its signals inside mips-linux-tdep.h
(see enum mips_signals). I could have used them, but I chose to
follow the standard and implement an enum containing only differences
between MIPS and x86 signals. In the battle between code duplication
and code standardization, the latter won (in my head, at least). But I
am totally open to suggestions, and I even believe I know what I will
hear: "Please, use mips_signals".
Anyway, I thought it was worth raising this point here.
As a side note, if "use mips_signals" wins, I intend to rename the
elements in the enum to MIPS_LINUX_SIG*, instead of just using
MIPS_SIG*. I guess that won't hurt.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* mips-linux-tdep.c: Define enum with differences between
* signals in MIPS and x86.
(mips_gdb_signal_to_target): New function.
(mips_linux_init_abi): Set gdbarch_gdb_signal_to_target to
mips_gdb_signal_to_target.
---
gdb/mips-linux-tdep.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 132 insertions(+)
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 484b39f..3aa6971 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -45,6 +45,42 @@
static struct target_so_ops mips_svr4_so_ops;
+/* This enum represents the signals' numbers on the MIPS
+ architecture. It just contains the signal definitions which are
+ different from x86.
+
+ It is derived from the file <arch/mips/include/uapi/asm/signal.h>,
+ from the Linux kernel tree. */
+
+enum
+ {
+ MIPS_LINUX_SIGEMT = 7,
+ MIPS_LINUX_SIGBUS = 10,
+ MIPS_LINUX_SIGSYS = 12,
+ MIPS_LINUX_SIGUSR1 = 16,
+ MIPS_LINUX_SIGUSR2 = 17,
+ MIPS_LINUX_SIGCHLD = 18,
+ MIPS_LINUX_SIGCLD = MIPS_LINUX_SIGCHLD,
+ MIPS_LINUX_SIGPWR = 19,
+ MIPS_LINUX_SIGWINCH = 20,
+ MIPS_LINUX_SIGURG = 21,
+ MIPS_LINUX_SIGIO = 22,
+ MIPS_LINUX_SIGPOLL = MIPS_LINUX_SIGIO,
+ MIPS_LINUX_SIGSTOP = 23,
+ MIPS_LINUX_SIGTSTP = 24,
+ MIPS_LINUX_SIGCONT = 25,
+ MIPS_LINUX_SIGTTIN = 26,
+ MIPS_LINUX_SIGTTOU = 27,
+ MIPS_LINUX_SIGVTALRM = 28,
+ MIPS_LINUX_SIGPROF = 29,
+ MIPS_LINUX_SIGXCPU = 30,
+ MIPS_LINUX_SIGXFSZ = 31,
+
+ MIPS_LINUX_SIGRTMIN = 32,
+ MIPS_LINUX_SIGRT64 = 64,
+ MIPS_LINUX_SIGRTMAX = 127,
+ };
+
/* Figure out where the longjmp will land.
We expect the first arg to be a pointer to the jmp_buf structure
from which we extract the pc (MIPS_LINUX_JB_PC) that we will land
@@ -1339,6 +1375,99 @@ mips_linux_get_syscall_number (struct gdbarch *gdbarch,
return ret;
}
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. */
+
+static int
+mips_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ case GDB_SIGNAL_EMT:
+ return MIPS_LINUX_SIGEMT;
+
+ case GDB_SIGNAL_BUS:
+ return MIPS_LINUX_SIGBUS;
+
+ case GDB_SIGNAL_SYS:
+ return MIPS_LINUX_SIGSYS;
+
+ case GDB_SIGNAL_USR1:
+ return MIPS_LINUX_SIGUSR1;
+
+ case GDB_SIGNAL_USR2:
+ return MIPS_LINUX_SIGUSR2;
+
+ case GDB_SIGNAL_CHLD:
+ return MIPS_LINUX_SIGCHLD;
+
+ case GDB_SIGNAL_PWR:
+ return MIPS_LINUX_SIGPWR;
+
+ case GDB_SIGNAL_WINCH:
+ return MIPS_LINUX_SIGWINCH;
+
+ case GDB_SIGNAL_URG:
+ return MIPS_LINUX_SIGURG;
+
+ case GDB_SIGNAL_IO:
+ return MIPS_LINUX_SIGIO;
+
+ case GDB_SIGNAL_POLL:
+ return MIPS_LINUX_SIGPOLL;
+
+ case GDB_SIGNAL_STOP:
+ return MIPS_LINUX_SIGSTOP;
+
+ case GDB_SIGNAL_TSTP:
+ return MIPS_LINUX_SIGTSTP;
+
+ case GDB_SIGNAL_CONT:
+ return MIPS_LINUX_SIGCONT;
+
+ case GDB_SIGNAL_TTIN:
+ return MIPS_LINUX_SIGTTIN;
+
+ case GDB_SIGNAL_TTOU:
+ return MIPS_LINUX_SIGTTOU;
+
+ case GDB_SIGNAL_VTALRM:
+ return MIPS_LINUX_SIGVTALRM;
+
+ case GDB_SIGNAL_PROF:
+ return MIPS_LINUX_SIGPROF;
+
+ case GDB_SIGNAL_XCPU:
+ return MIPS_LINUX_SIGXCPU;
+
+ case GDB_SIGNAL_XFSZ:
+ return MIPS_LINUX_SIGXFSZ;
+
+ /* GDB_SIGNAL_REALTIME_32 is not continuous in <gdb/signals.def>,
+ therefore we have to handle it here. */
+ case GDB_SIGNAL_REALTIME_32:
+ return MIPS_LINUX_SIGRTMIN;
+ }
+
+ if (signal >= GDB_SIGNAL_REALTIME_33
+ && signal <= GDB_SIGNAL_REALTIME_63)
+ {
+ int offset = signal - GDB_SIGNAL_REALTIME_33;
+
+ return MIPS_LINUX_SIGRTMIN + 1 + offset;
+ }
+ else if (signal >= GDB_SIGNAL_REALTIME_64
+ && signal <= GDB_SIGNAL_REALTIME_127)
+ {
+ int offset = signal - GDB_SIGNAL_REALTIME_64;
+
+ return MIPS_LINUX_SIGRT64 + offset;
+ }
+
+ return linux_gdb_signal_to_target (gdbarch, signal);
+}
+
/* Translate signals based on MIPS signal values.
Adapted from gdb/common/signals.c. */
@@ -1516,6 +1645,9 @@ mips_linux_init_abi (struct gdbarch_info info,
set_gdbarch_gdb_signal_from_target (gdbarch,
mips_gdb_signal_from_target);
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ mips_gdb_signal_to_target);
+
tdep->syscall_next_pc = mips_linux_syscall_next_pc;
if (tdesc_data)
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 14/17] s390 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (6 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 09/17] i386 support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 13/17] mn10300 support Sergio Durigan Junior
` (12 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
Support for s390. Trivial: shares signal numbers with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* s390-tdep.c (s390_gdbarch_init): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/s390-tdep.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 6111bbf..bae2a7d 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -3304,6 +3304,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_stap_register_indirection_suffix (gdbarch, ")");
set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand);
+ set_gdbarch_gdb_signal_to_target (gdbarch, linux_gdb_signal_to_target);
+
return gdbarch;
}
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 09/17] i386 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (5 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 15/17] SPARC support Sergio Durigan Junior
@ 2013-07-01 7:43 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 14/17] s390 support Sergio Durigan Junior
` (13 subsequent siblings)
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 7:43 UTC (permalink / raw)
To: GDB Patches; +Cc: Sergio Durigan Junior
i386 support. Really trivial; only set gdbarch_gdb_signal_to_target.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* i386-linux-tdep.c (i386_linux_init_abi): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/i386-linux-tdep.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index fc9de62..cf6c412 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -964,6 +964,11 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_get_syscall_number (gdbarch,
i386_linux_get_syscall_number);
+ /* Convert the internal GDB signal representation to the
+ target's. */
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ linux_gdb_signal_to_target);
+
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
}
--
1.7.11.7
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 00/17] Implement gdbarch_gdb_signal_to_target
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (16 preceding siblings ...)
2013-07-01 7:43 ` [PATCH 06/17] AVR support Sergio Durigan Junior
@ 2013-07-01 8:43 ` Andreas Schwab
2013-07-01 10:40 ` Sergio Durigan Junior
2013-07-01 10:46 ` [PATCH 18/18] AArch64 support Sergio Durigan Junior
` (2 subsequent siblings)
20 siblings, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2013-07-01 8:43 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: GDB Patches
Sergio Durigan Junior <sergiodj@redhat.com> writes:
> What I did was to investigate, on the Linux kernel, which targets shared
> the signal numbers definition with x86. My approach was to make the x86
> the "de facto" implementation, and extend only the needed bits on each
> arch. For the record, I used linux-3.10-rc6 as the main source of
> information, always looking at
> arch/<ARCH_NAME>/include/uapi/asm/signal.h. For SIGRTMAX (which defaults
> to _NSIG in most cases), I had to look at different signal-related
> files, but most of them (except MIPS) were defined to 64 anyway.
There is also include/uapi/asm-generic/signal.h (which happens to agree
with x86 numbering) which will be used for every new architecture port.
(Looks like you missed out aarch64.)
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 00/17] Implement gdbarch_gdb_signal_to_target
2013-07-01 8:43 ` [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Andreas Schwab
@ 2013-07-01 10:40 ` Sergio Durigan Junior
2013-07-01 10:44 ` Pedro Alves
0 siblings, 1 reply; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 10:40 UTC (permalink / raw)
To: Andreas Schwab; +Cc: GDB Patches
On Monday, July 01 2013, Andreas Schwab wrote:
> Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
>> What I did was to investigate, on the Linux kernel, which targets shared
>> the signal numbers definition with x86. My approach was to make the x86
>> the "de facto" implementation, and extend only the needed bits on each
>> arch. For the record, I used linux-3.10-rc6 as the main source of
>> information, always looking at
>> arch/<ARCH_NAME>/include/uapi/asm/signal.h. For SIGRTMAX (which defaults
>> to _NSIG in most cases), I had to look at different signal-related
>> files, but most of them (except MIPS) were defined to 64 anyway.
>
> There is also include/uapi/asm-generic/signal.h (which happens to agree
> with x86 numbering) which will be used for every new architecture port.
Thanks for pointing that out.
> (Looks like you missed out aarch64.)
Indeed. I will submit the patch with the funny subject "[PATCH
18/17]".
Thanks,
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 00/17] Implement gdbarch_gdb_signal_to_target
2013-07-01 10:40 ` Sergio Durigan Junior
@ 2013-07-01 10:44 ` Pedro Alves
2013-07-01 10:59 ` Sergio Durigan Junior
0 siblings, 1 reply; 34+ messages in thread
From: Pedro Alves @ 2013-07-01 10:44 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: Andreas Schwab, GDB Patches
On 07/01/2013 11:40 AM, Sergio Durigan Junior wrote:
>> > There is also include/uapi/asm-generic/signal.h (which happens to agree
>> > with x86 numbering) which will be used for every new architecture port.
> Thanks for pointing that out.
Could you update the comments in gdb/linux-tdep.c, etc. in that direction?
No need to talk about x86 as some sort of template arch if going forward the
kernel has a truly generic header.
--
Pedro Alves
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 18/18] AArch64 support
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (17 preceding siblings ...)
2013-07-01 8:43 ` [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Andreas Schwab
@ 2013-07-01 10:46 ` Sergio Durigan Junior
2013-07-08 23:08 ` [ping][PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
2013-07-17 18:02 ` [PATCH " Tom Tromey
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 10:46 UTC (permalink / raw)
To: GDB Patches
[Andreas noticed that I forgot about AArch64, so here is the patch.
Sorry for the confusion.]
Support for AArch64 target. Trivial, since it shares the signal numbers
with x86.
2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Set
gdbarch_gdb_signal_to_target to linux_gdb_signal_to_target.
---
gdb/aarch64-linux-tdep.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 8e66425..324cc8c 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -288,6 +288,9 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_regset_from_core_section (gdbarch,
aarch64_linux_regset_from_core_section);
+
+ set_gdbarch_gdb_signal_to_target (gdbarch,
+ linux_gdb_signal_to_target);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 02/17] Linux kernel generic support
2013-07-01 7:43 ` [PATCH 02/17] Linux kernel generic support Sergio Durigan Junior
@ 2013-07-01 10:57 ` Sergio Durigan Junior
0 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 10:57 UTC (permalink / raw)
To: GDB Patches
On Monday, July 01 2013, I wrote:
> This is, along with the gdbarch changes, the main patch of this series.
> It implements the generic converter between GDB's internal signals and
> x86 ones.
According to Andreas' and Pedro's comments, here is a new patch which
updates the comment on linux-tdep.c's enum definition. The ChangeLog is
the same.
> 2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * linux-tdep.c: Define enum with x86 signal numbers.
> (linux_gdb_signal_to_target): New function.
> * linux-tdep.h (linux_gdb_signal_to_target): New prototype.
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index bfb6404..ec39060 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -36,6 +36,63 @@
#include <ctype.h>
+/* This enum represents the signals' numbers on a generic architecture
+ running the Linux kernel. The definition of "generic" comes from
+ the file <include/uapi/asm-generic/signal.h>, from the Linux kernel
+ tree, which is the "de facto" implementation of signal numbers to
+ be used by new architecture ports.
+
+ For those architectures which have differences from the generic
+ standard (e.g., Alpha), we define the different signals (and *only*
+ those) in the specific target-dependent file (e.g.,
+ alpha-linux-tdep.c, for Alpha). Please refer to the architecture's
+ tdep file for more information.
+
+ As stated above, this enum is derived from
+ <include/uapi/asm-generic/signal.h>, from the Linux kernel
+ tree. */
+
+enum
+ {
+ LINUX_SIGHUP = 1,
+ LINUX_SIGINT = 2,
+ LINUX_SIGQUIT = 3,
+ LINUX_SIGILL = 4,
+ LINUX_SIGTRAP = 5,
+ LINUX_SIGABRT = 6,
+ LINUX_SIGIOT = 6,
+ LINUX_SIGBUS = 7,
+ LINUX_SIGFPE = 8,
+ LINUX_SIGKILL = 9,
+ LINUX_SIGUSR1 = 10,
+ LINUX_SIGSEGV = 11,
+ LINUX_SIGUSR2 = 12,
+ LINUX_SIGPIPE = 13,
+ LINUX_SIGALRM = 14,
+ LINUX_SIGTERM = 15,
+ LINUX_SIGSTKFLT = 16,
+ LINUX_SIGCHLD = 17,
+ LINUX_SIGCONT = 18,
+ LINUX_SIGSTOP = 19,
+ LINUX_SIGTSTP = 20,
+ LINUX_SIGTTIN = 21,
+ LINUX_SIGTTOU = 22,
+ LINUX_SIGURG = 23,
+ LINUX_SIGXCPU = 24,
+ LINUX_SIGXFSZ = 25,
+ LINUX_SIGVTALRM = 26,
+ LINUX_SIGPROF = 27,
+ LINUX_SIGWINCH = 28,
+ LINUX_SIGIO = 29,
+ LINUX_SIGPOLL = LINUX_SIGIO,
+ LINUX_SIGPWR = 30,
+ LINUX_SIGSYS = 31,
+ LINUX_SIGUNUSED = 31,
+
+ LINUX_SIGRTMIN = 32,
+ LINUX_SIGRTMAX = 64,
+ };
+
static struct gdbarch_data *linux_gdbarch_data_handle;
struct linux_gdbarch_data
@@ -1447,6 +1504,134 @@ linux_make_corefile_notes_1 (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
linux_collect_thread_registers);
}
+/* Implementation of `gdbarch_gdb_signal_to_target', as defined in
+ gdbarch.h. This function is not static because it is exported to
+ other -tdep files. */
+
+int
+linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal)
+{
+ switch (signal)
+ {
+ case GDB_SIGNAL_0:
+ return 0;
+
+ case GDB_SIGNAL_HUP:
+ return LINUX_SIGHUP;
+
+ case GDB_SIGNAL_INT:
+ return LINUX_SIGINT;
+
+ case GDB_SIGNAL_QUIT:
+ return LINUX_SIGQUIT;
+
+ case GDB_SIGNAL_ILL:
+ return LINUX_SIGILL;
+
+ case GDB_SIGNAL_TRAP:
+ return LINUX_SIGTRAP;
+
+ case GDB_SIGNAL_ABRT:
+ return LINUX_SIGABRT;
+
+ case GDB_SIGNAL_FPE:
+ return LINUX_SIGFPE;
+
+ case GDB_SIGNAL_KILL:
+ return LINUX_SIGKILL;
+
+ case GDB_SIGNAL_BUS:
+ return LINUX_SIGBUS;
+
+ case GDB_SIGNAL_SEGV:
+ return LINUX_SIGSEGV;
+
+ case GDB_SIGNAL_SYS:
+ return LINUX_SIGSYS;
+
+ case GDB_SIGNAL_PIPE:
+ return LINUX_SIGPIPE;
+
+ case GDB_SIGNAL_ALRM:
+ return LINUX_SIGALRM;
+
+ case GDB_SIGNAL_TERM:
+ return LINUX_SIGTERM;
+
+ case GDB_SIGNAL_URG:
+ return LINUX_SIGURG;
+
+ case GDB_SIGNAL_STOP:
+ return LINUX_SIGSTOP;
+
+ case GDB_SIGNAL_TSTP:
+ return LINUX_SIGTSTP;
+
+ case GDB_SIGNAL_CONT:
+ return LINUX_SIGCONT;
+
+ case GDB_SIGNAL_CHLD:
+ return LINUX_SIGCHLD;
+
+ case GDB_SIGNAL_TTIN:
+ return LINUX_SIGTTIN;
+
+ case GDB_SIGNAL_TTOU:
+ return LINUX_SIGTTOU;
+
+ case GDB_SIGNAL_IO:
+ return LINUX_SIGIO;
+
+ case GDB_SIGNAL_XCPU:
+ return LINUX_SIGXCPU;
+
+ case GDB_SIGNAL_XFSZ:
+ return LINUX_SIGXFSZ;
+
+ case GDB_SIGNAL_VTALRM:
+ return LINUX_SIGVTALRM;
+
+ case GDB_SIGNAL_PROF:
+ return LINUX_SIGPROF;
+
+ case GDB_SIGNAL_WINCH:
+ return LINUX_SIGWINCH;
+
+ case GDB_SIGNAL_USR1:
+ return LINUX_SIGUSR1;
+
+ case GDB_SIGNAL_USR2:
+ return LINUX_SIGUSR2;
+
+ case GDB_SIGNAL_PWR:
+ return LINUX_SIGPWR;
+
+ case GDB_SIGNAL_POLL:
+ return LINUX_SIGPOLL;
+
+ /* GDB_SIGNAL_REALTIME_32 is not continuous in <gdb/signals.def>,
+ therefore we have to handle it here. */
+ case GDB_SIGNAL_REALTIME_32:
+ return LINUX_SIGRTMIN;
+
+ /* Same comment applies to _64. */
+ case GDB_SIGNAL_REALTIME_64:
+ return LINUX_SIGRTMAX;
+ }
+
+ /* GDB_SIGNAL_REALTIME_33 to _64 are continuous. */
+ if (signal >= GDB_SIGNAL_REALTIME_33
+ && signal <= GDB_SIGNAL_REALTIME_63)
+ {
+ int offset = signal - GDB_SIGNAL_REALTIME_33;
+
+ return LINUX_SIGRTMIN + 1 + offset;
+ }
+
+ return -1;
+}
+
/* To be called from the various GDB_OSABI_LINUX handlers for the
various GNU/Linux architectures and machine types. */
diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h
index 380507e..c1d80de 100644
--- a/gdb/linux-tdep.h
+++ b/gdb/linux-tdep.h
@@ -34,6 +34,9 @@ char *linux_make_corefile_notes (struct gdbarch *, bfd *, int *,
struct type *linux_get_siginfo_type (struct gdbarch *);
+extern int linux_gdb_signal_to_target (struct gdbarch *gdbarch,
+ enum gdb_signal signal);
+
extern void linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
#endif /* linux-tdep.h */
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 00/17] Implement gdbarch_gdb_signal_to_target
2013-07-01 10:44 ` Pedro Alves
@ 2013-07-01 10:59 ` Sergio Durigan Junior
0 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-01 10:59 UTC (permalink / raw)
To: Pedro Alves; +Cc: Andreas Schwab, GDB Patches
On Monday, July 01 2013, Pedro Alves wrote:
> On 07/01/2013 11:40 AM, Sergio Durigan Junior wrote:
>>> > There is also include/uapi/asm-generic/signal.h (which happens to agree
>>> > with x86 numbering) which will be used for every new architecture port.
>> Thanks for pointing that out.
>
> Could you update the comments in gdb/linux-tdep.c, etc. in that direction?
> No need to talk about x86 as some sort of template arch if going forward the
> kernel has a truly generic header.
Done. Thanks.
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [ping][PATCH 00/17] Implement gdbarch_gdb_signal_to_target
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (18 preceding siblings ...)
2013-07-01 10:46 ` [PATCH 18/18] AArch64 support Sergio Durigan Junior
@ 2013-07-08 23:08 ` Sergio Durigan Junior
2013-07-17 18:02 ` [PATCH " Tom Tromey
20 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-08 23:08 UTC (permalink / raw)
To: GDB Patches
On Monday, July 01 2013, I wrote:
> Hello,
Ping.
> This patch implements the new gdbarch method gdbarch_gdb_signal_to_target.
> It will be used when one wants to convert between the internal GDB signal
> representation (enum gdb_signal) and the target's representation.
>
> The idea of this patch came from a chat between Pedro and I on IRC, plus
> the discussion of my patches to add the new $_exitsignal convenience
> variable:
>
> <http://sourceware.org/ml/gdb-patches/2013-06/msg00452.html>
> <http://sourceware.org/ml/gdb-patches/2013-06/msg00352.html>
>
> What I did was to investigate, on the Linux kernel, which targets shared
> the signal numbers definition with x86. My approach was to make the x86
> the "de facto" implementation, and extend only the needed bits on each
> arch. For the record, I used linux-3.10-rc6 as the main source of
> information, always looking at
> arch/<ARCH_NAME>/include/uapi/asm/signal.h. For SIGRTMAX (which defaults
> to _NSIG in most cases), I had to look at different signal-related
> files, but most of them (except MIPS) were defined to 64 anyway.
>
> Then, with all the differences in hand, I implemented the bits on each
> target. Since I obviously don't have access to all targets, I could not
> compile GDB to make sure everything worked on each one of them, but I'd
> be surprised if it didn't. I also am not submitting a testcase with
> this patch because the gdbarch method is not being used anywhere yet; I
> should send a proper testcase when I resubmit the $_exitsignal + $_signo
> patches, because they will make use of the method.
>
> I would appreciate if you could take a look and tell me your opinions.
> Most of the patches are trivial, because they share all the signal
> numbers with x86. If you want to narrow your review, I'd recommend
> taking a look at the patches 01, 02, and 17 (MIPS, see the message +
> patch for more explanations). Also, if you intend to test the
> compilation of this patch on some architecture, you will need patches
> 01 and 02 to successfully compile it.
>
> OK to apply? Comments are welcome.
>
> Thanks.
>
> --
> Sergio
>
> gdb/alpha-linux-tdep.c | 89 +++++++++++++++++++++++
> gdb/amd64-linux-tdep.c | 5 ++
> gdb/arm-linux-tdep.c | 14 ++++
> gdb/avr-tdep.c | 50 +++++++++++++
> gdb/cris-tdep.c | 5 +-
> gdb/gdbarch.c | 33 +++++++++
> gdb/gdbarch.h | 14 ++++
> gdb/gdbarch.sh | 9 +++
> gdb/h8300-tdep.c | 4 ++
> gdb/i386-linux-tdep.c | 5 ++
> gdb/ia64-linux-tdep.c | 2 +
> gdb/linux-tdep.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++
> gdb/linux-tdep.h | 3 +
> gdb/m32r-linux-tdep.c | 2 +
> gdb/m68klinux-tdep.c | 3 +
> gdb/mips-linux-tdep.c | 132 ++++++++++++++++++++++++++++++++++
> gdb/mn10300-linux-tdep.c | 2 +
> gdb/s390-tdep.c | 2 +
> gdb/sparc-linux-tdep.c | 83 +++++++++++++++++++++
> gdb/xtensa-linux-tdep.c | 49 +++++++++++++
> 20 files changed, 687 insertions(+), 1 deletion(-)
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 04/17] x86_64 support
2013-07-01 7:43 ` [PATCH 04/17] x86_64 support Sergio Durigan Junior
@ 2013-07-17 17:16 ` Tom Tromey
2013-07-17 19:00 ` Mark Kettenis
2013-07-17 19:11 ` Sergio Durigan Junior
0 siblings, 2 replies; 34+ messages in thread
From: Tom Tromey @ 2013-07-17 17:16 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: GDB Patches
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> 2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
Sergio> * amd64-linux-tdep.c (amd64_linux_init_abi_common): Set
Sergio> gdbarch_gdb_signal_to_target as linux_gdb_signal_to_target.
Why not set this in linux_init_abi?
Then most of the *-linux-tdep.c files won't need to be changed at all --
just the ones that need to override this method.
Tom
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 05/17] ARM support
2013-07-01 7:43 ` [PATCH 05/17] ARM support Sergio Durigan Junior
@ 2013-07-17 17:20 ` Tom Tromey
2013-07-25 6:25 ` Sergio Durigan Junior
0 siblings, 1 reply; 34+ messages in thread
From: Tom Tromey @ 2013-07-17 17:20 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: GDB Patches
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> Support for the ARM target. Even though ARM shares almost everything
Sergio> with x86 regarding signal numbers, there is SIGSWI which is an ARM-only
Sergio> signal as far as I have verified. However, GDB's internal signal
Sergio> definition does not recognize SIGSWI, so there is nothing we can/must
Sergio> do.
I think this is a bit peculiar in a couple of ways.
SIGSWI has the same value as SIGRTMIN.
So there is some confusion somewhere.
At the very least, it seems like if this is correct, then we maybe
couldn't sensible translate SIGSWI.
Second, the new enum seems like dead code. It's only a matter of time
until someone notices and removes it. Perhaps a comment somewhere would
be better.
Tom
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 17/17] MIPS support
2013-07-01 7:43 ` [PATCH 17/17] MIPS support Sergio Durigan Junior
@ 2013-07-17 17:59 ` Tom Tromey
2013-07-25 6:20 ` Sergio Durigan Junior
0 siblings, 1 reply; 34+ messages in thread
From: Tom Tromey @ 2013-07-17 17:59 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: GDB Patches
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> MIPS already has a definition of its signals inside mips-linux-tdep.h
Sergio> (see enum mips_signals). I could have used them, but I chose to
Sergio> follow the standard and implement an enum containing only differences
Sergio> between MIPS and x86 signals. In the battle between code duplication
Sergio> and code standardization, the latter won (in my head, at least). But I
Sergio> am totally open to suggestions, and I even believe I know what I will
Sergio> hear: "Please, use mips_signals".
Sergio> Anyway, I thought it was worth raising this point here.
Thanks.
One thing I'm curious about is why the corresponding
gdbarch_gdb_signal_from_target method is only implemented for MIPS, and
not for all Linux targets.
Consideration of this led me to another possible approach to the problem
you mention above: you could use your standard approach for the enum,
but also reimplement the MIPS gdbarch_gdb_signal_from_target method to
follow. This would be simpler there was already a generic implementation...
Tom
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 00/17] Implement gdbarch_gdb_signal_to_target
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
` (19 preceding siblings ...)
2013-07-08 23:08 ` [ping][PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
@ 2013-07-17 18:02 ` Tom Tromey
20 siblings, 0 replies; 34+ messages in thread
From: Tom Tromey @ 2013-07-17 18:02 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: GDB Patches
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> This patch implements the new gdbarch method
Sergio> gdbarch_gdb_signal_to_target. It will be used when one wants to
Sergio> convert between the internal GDB signal representation (enum
Sergio> gdb_signal) and the target's representation.
Thanks Sergio.
I sent my comments on all the particular patches.
I think the idea as a whole is fine and we're just nailing down nits.
Tom
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 04/17] x86_64 support
2013-07-17 17:16 ` Tom Tromey
@ 2013-07-17 19:00 ` Mark Kettenis
2013-07-17 19:11 ` Sergio Durigan Junior
1 sibling, 0 replies; 34+ messages in thread
From: Mark Kettenis @ 2013-07-17 19:00 UTC (permalink / raw)
To: tromey; +Cc: sergiodj, gdb-patches
> From: Tom Tromey <tromey@redhat.com>
> Date: Wed, 17 Jul 2013 11:16:13 -0600
>
> >>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> 2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
> Sergio> * amd64-linux-tdep.c (amd64_linux_init_abi_common): Set
> Sergio> gdbarch_gdb_signal_to_target as linux_gdb_signal_to_target.
>
> Why not set this in linux_init_abi?
> Then most of the *-linux-tdep.c files won't need to be changed at all --
> just the ones that need to override this method.
That would make a lot of sense.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 04/17] x86_64 support
2013-07-17 17:16 ` Tom Tromey
2013-07-17 19:00 ` Mark Kettenis
@ 2013-07-17 19:11 ` Sergio Durigan Junior
1 sibling, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-17 19:11 UTC (permalink / raw)
To: Tom Tromey; +Cc: GDB Patches
On Wednesday, July 17 2013, Tom Tromey wrote:
>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> 2013-07-01 Sergio Durigan Junior <sergiodj@redhat.com>
> Sergio> * amd64-linux-tdep.c (amd64_linux_init_abi_common): Set
> Sergio> gdbarch_gdb_signal_to_target as linux_gdb_signal_to_target.
>
> Why not set this in linux_init_abi?
> Then most of the *-linux-tdep.c files won't need to be changed at all --
> just the ones that need to override this method.
[Hm, I could say now that I knew all about it, and I was just testing
everyone's knowledge about the GDB codebase!]
Anyway, thanks a lot, you're completely right, I will re-send the
series with this modification.
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 17/17] MIPS support
2013-07-17 17:59 ` Tom Tromey
@ 2013-07-25 6:20 ` Sergio Durigan Junior
2013-07-29 20:15 ` Pedro Alves
0 siblings, 1 reply; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-25 6:20 UTC (permalink / raw)
To: Tom Tromey; +Cc: GDB Patches
On Wednesday, July 17 2013, Tom Tromey wrote:
>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> MIPS already has a definition of its signals inside mips-linux-tdep.h
> Sergio> (see enum mips_signals). I could have used them, but I chose to
> Sergio> follow the standard and implement an enum containing only differences
> Sergio> between MIPS and x86 signals. In the battle between code duplication
> Sergio> and code standardization, the latter won (in my head, at least). But I
> Sergio> am totally open to suggestions, and I even believe I know what I will
> Sergio> hear: "Please, use mips_signals".
>
> Sergio> Anyway, I thought it was worth raising this point here.
>
> Thanks.
>
> One thing I'm curious about is why the corresponding
> gdbarch_gdb_signal_from_target method is only implemented for MIPS, and
> not for all Linux targets.
Thanks for the review.
The gdbarch_gdb_signal_from_target method for MIPS was introduced by:
<http://sourceware.org/ml/gdb-patches/2012-06/msg00048.html>
As far as I can tell, nobody really cared about implementing it for
other architectures. So far.
I now have a patch which does that for the same architectures that I am
touching to implement the gdbarch_gdb_signal_to_target method, and I
will submit it along with the other patches.
> Consideration of this led me to another possible approach to the problem
> you mention above: you could use your standard approach for the enum,
> but also reimplement the MIPS gdbarch_gdb_signal_from_target method to
> follow. This would be simpler there was already a generic implementation...
Sounds good to me, done that.
Thanks,
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 05/17] ARM support
2013-07-17 17:20 ` Tom Tromey
@ 2013-07-25 6:25 ` Sergio Durigan Junior
0 siblings, 0 replies; 34+ messages in thread
From: Sergio Durigan Junior @ 2013-07-25 6:25 UTC (permalink / raw)
To: Tom Tromey; +Cc: GDB Patches
On Wednesday, July 17 2013, Tom Tromey wrote:
>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> Support for the ARM target. Even though ARM shares almost everything
> Sergio> with x86 regarding signal numbers, there is SIGSWI which is an ARM-only
> Sergio> signal as far as I have verified. However, GDB's internal signal
> Sergio> definition does not recognize SIGSWI, so there is nothing we can/must
> Sergio> do.
>
> I think this is a bit peculiar in a couple of ways.
>
> SIGSWI has the same value as SIGRTMIN.
> So there is some confusion somewhere.
> At the very least, it seems like if this is correct, then we maybe
> couldn't sensible translate SIGSWI.
No, apparently we couldn't. Doing a further investigation on the kernel
sources, the only mention I found to SIGSWI (not counting the
declaration itself) is on the file <arch/arm/kernel/arthur.c>, some
apparently odd ARM-based (RISCOS) OS which uses this communicate with
its emulator somehow. It is called Arthur OS, and I don't think we
support it in any way.
So, after seeing this, I think we shouldn't care about this until we
choose to support the OS.
> Second, the new enum seems like dead code. It's only a matter of time
> until someone notices and removes it. Perhaps a comment somewhere would
> be better.
Fair enough, I will make a comment somewhere explaining this.
Thanks,
--
Sergio
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 17/17] MIPS support
2013-07-25 6:20 ` Sergio Durigan Junior
@ 2013-07-29 20:15 ` Pedro Alves
0 siblings, 0 replies; 34+ messages in thread
From: Pedro Alves @ 2013-07-29 20:15 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: Tom Tromey, GDB Patches
On 07/25/2013 07:19 AM, Sergio Durigan Junior wrote:
> On Wednesday, July 17 2013, Tom Tromey wrote:
>
>>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>>
>> Sergio> MIPS already has a definition of its signals inside mips-linux-tdep.h
>> Sergio> (see enum mips_signals). I could have used them, but I chose to
>> Sergio> follow the standard and implement an enum containing only differences
>> Sergio> between MIPS and x86 signals. In the battle between code duplication
>> Sergio> and code standardization, the latter won (in my head, at least). But I
>> Sergio> am totally open to suggestions, and I even believe I know what I will
>> Sergio> hear: "Please, use mips_signals".
>>
>> Sergio> Anyway, I thought it was worth raising this point here.
>>
>> Thanks.
>>
>> One thing I'm curious about is why the corresponding
>> gdbarch_gdb_signal_from_target method is only implemented for MIPS, and
>> not for all Linux targets.
>
> Thanks for the review.
>
> The gdbarch_gdb_signal_from_target method for MIPS was introduced by:
>
> <http://sourceware.org/ml/gdb-patches/2012-06/msg00048.html>
>
> As far as I can tell, nobody really cared about implementing it for
> other architectures. So far.
>
> I now have a patch which does that for the same architectures that I am
> touching to implement the gdbarch_gdb_signal_to_target method, and I
> will submit it along with the other patches.
Nice. That'll get us further along the
core-debugging-should-be-host-independent idea. That fits nicely
along earlier prpsinfo bfd work in that direction too. :-) Hmm,
maybe we should have a wiki page for that whole project.
--
Pedro Alves
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2013-07-29 20:15 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01 7:43 [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 11/17] m32r support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 05/17] ARM support Sergio Durigan Junior
2013-07-17 17:20 ` Tom Tromey
2013-07-25 6:25 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 10/17] IA-64 support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 02/17] Linux kernel generic support Sergio Durigan Junior
2013-07-01 10:57 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 08/17] h8300 support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 15/17] SPARC support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 09/17] i386 support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 14/17] s390 support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 13/17] mn10300 support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 03/17] Alpha support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 01/17] Implement the gdbarch.{sh,c,h} bits Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 12/17] m68klinux support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 17/17] MIPS support Sergio Durigan Junior
2013-07-17 17:59 ` Tom Tromey
2013-07-25 6:20 ` Sergio Durigan Junior
2013-07-29 20:15 ` Pedro Alves
2013-07-01 7:43 ` [PATCH 16/17] Xtensa support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 07/17] Cris support Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 04/17] x86_64 support Sergio Durigan Junior
2013-07-17 17:16 ` Tom Tromey
2013-07-17 19:00 ` Mark Kettenis
2013-07-17 19:11 ` Sergio Durigan Junior
2013-07-01 7:43 ` [PATCH 06/17] AVR support Sergio Durigan Junior
2013-07-01 8:43 ` [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Andreas Schwab
2013-07-01 10:40 ` Sergio Durigan Junior
2013-07-01 10:44 ` Pedro Alves
2013-07-01 10:59 ` Sergio Durigan Junior
2013-07-01 10:46 ` [PATCH 18/18] AArch64 support Sergio Durigan Junior
2013-07-08 23:08 ` [ping][PATCH 00/17] Implement gdbarch_gdb_signal_to_target Sergio Durigan Junior
2013-07-17 18:02 ` [PATCH " Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox