From: Pedro Alves <pedro_alves@portugalmail.pt>
To: gdb-patches@sourceware.org
Subject: [gdbserver] Use enum target_signal in _send_signal.
Date: Sat, 24 Feb 2007 23:24:00 -0000 [thread overview]
Message-ID: <45E0C90C.7030101@portugalmail.pt> (raw)
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
Hi all,
This patch converts the send_signal function in target_ops to use enum
target_signal
instead of the real target number. I originally needed this for the
WinCE gdbserver port.
Windows CE doesn't have signals support, and doesn't define SIGINT in
any header.
Because of that, remote-utils.c wouldn't compile. I still want to have
support of stopping
a debuggee - this patch paves the way to that, with minimal interface
changes. I will handle
TARGET_SIGNAL_INT in the send_signal handler on the target side.
Ok?
Cheers,
Pedro Alves
---
gdb/gdbserver/ChangeLog:
2007-02-24 Pedro Alves <pedro_alves@portugalmail.pt>
* target.h (target_ops): Change parameter of send_signal from int to
enum target_signal.
* linux-low.c (linux_send_signal): Change parameter from int to
enum target_signal.
* spu-low.c (spu_send_signal): Likewise.
* remote-utils.c (putpkt_binary): Pass TARGET_SIGNAL_INT instead
of SIGINT.
(input_interrupt): Likewise.
[-- Attachment #2: target_signal.diff --]
[-- Type: text/plain, Size: 2634 bytes --]
Index: src/gdb/gdbserver/linux-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-low.c 2007-02-24 23:04:16.000000000 +0000
+++ src/gdb/gdbserver/linux-low.c 2007-02-24 23:05:54.000000000 +0000
@@ -1514,9 +1514,13 @@
}
static void
-linux_send_signal (int signum)
+linux_send_signal (enum target_signal sig)
{
extern unsigned long signal_pid;
+ int signum = target_signal_to_host (sig);
+
+ if (signum == 0)
+ return;
if (cont_thread != 0 && cont_thread != -1)
{
Index: src/gdb/gdbserver/spu-low.c
===================================================================
--- src.orig/gdb/gdbserver/spu-low.c 2007-02-24 23:04:16.000000000 +0000
+++ src/gdb/gdbserver/spu-low.c 2007-02-24 23:05:54.000000000 +0000
@@ -551,8 +551,13 @@
/* Send signal to inferior. */
static void
-spu_send_signal (int signo)
+spu_send_signal (enum target_signal sig)
{
+ int signo = target_signal_to_host (sig);
+
+ if (signo == 0)
+ return;
+
syscall (SYS_tkill, current_tid, signo);
}
Index: src/gdb/gdbserver/target.h
===================================================================
--- src.orig/gdb/gdbserver/target.h 2007-02-24 23:04:16.000000000 +0000
+++ src/gdb/gdbserver/target.h 2007-02-24 23:05:54.000000000 +0000
@@ -128,7 +128,7 @@
void (*look_up_symbols) (void);
/* Send a signal to the inferior process, however is appropriate. */
- void (*send_signal) (int);
+ void (*send_signal) (enum target_signal);
/* Read auxiliary vector data from the inferior process.
Index: src/gdb/gdbserver/remote-utils.c
===================================================================
--- src.orig/gdb/gdbserver/remote-utils.c 2007-02-24 23:04:20.000000000 +0000
+++ src/gdb/gdbserver/remote-utils.c 2007-02-24 23:05:54.000000000 +0000
@@ -549,7 +549,7 @@
/* Check for an input interrupt while we're here. */
if (buf3[0] == '\003')
- (*the_target->send_signal) (SIGINT);
+ (*the_target->send_signal) (TARGET_SIGNAL_INT);
}
while (buf3[0] != '+');
@@ -572,7 +572,7 @@
/* Come here when we get an input interrupt from the remote side. This
interrupt should only be active while we are waiting for the child to do
something. About the only thing that should come through is a ^C, which
- will cause us to send a SIGINT to the child. */
+ will cause us to send a TARGET_SIGNAL_INT to the child. */
static void
input_interrupt (int unused)
@@ -599,7 +599,7 @@
return;
}
- (*the_target->send_signal) (SIGINT);
+ (*the_target->send_signal) (TARGET_SIGNAL_INT);
}
}
#endif
next reply other threads:[~2007-02-24 23:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-24 23:24 Pedro Alves [this message]
2007-02-25 2:11 ` Daniel Jacobowitz
2007-02-25 3:20 ` Pedro Alves
2007-02-25 17:22 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45E0C90C.7030101@portugalmail.pt \
--to=pedro_alves@portugalmail.pt \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox