This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 1/9]#2 Rename `enum target_signal' to target_signal_t
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 30 Aug 2010 09:10:40 +0200
- Subject: [patch 1/9]#2 Rename `enum target_signal' to target_signal_t
series #2 of: http://sourceware.org/ml/gdb-patches/2010-07/msg00408.html
Hi,
there is no compiled code change in this patch. This patch just renames `enum
target_signal' to target_signal_t (typedef) so the code is more flexible for
the later changes. No other change is made.
Thanks,
Jan
include/gdb/
2010-08-29 Jan Kratochvil <jan.kratochvil@redhat.com>
Rename enum target_signal to target_signal_t.
* signals.h (enum target_signal): Rename to ...
(target_signal_t): ... this one.
gdb/gdbserver/
2010-08-29 Jan Kratochvil <jan.kratochvil@redhat.com>
Rename enum target_signal to target_signal_t.
* target.h, win32-low.c: Rename all the uses of enum target_signal to
target_signal_t.
sim/common/
2010-08-29 Jan Kratochvil <jan.kratochvil@redhat.com>
Rename enum target_signal to target_signal_t.
* sim-signal.c, sim-signal.h: Rename all the uses of enum
target_signal to target_signal_t.
gdb/
2010-08-29 Jan Kratochvil <jan.kratochvil@redhat.com>
Rename enum target_signal to target_signal_t.
* aix-thread.c, amd64-linux-tdep.c, bsd-uthread.c,
common/gdb_signals.h, common/signals.c, corelow.c, darwin-nat.c,
defs.h, fbsd-nat.c, gdbarch.c, gdbarch.h, gdbarch.sh, gdbthread.h,
gnu-nat.c, go32-nat.c, hpux-thread.c, i386-linux-nat.c,
i386-linux-tdep.c, i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c,
infcmd.c, inferior.h, infrun.c, linux-nat.c, linux-thread-db.c,
monitor.c, nto-procfs.c, procfs.c, record.c, remote-m32r-sdi.c,
remote-mips.c, remote-sim.c, remote.c, sol-thread.c, target.c,
target.h, windows-nat.c: Rename all the uses of enum target_signal to
target_signal_t.
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -970,7 +970,7 @@ aix_thread_detach (struct target_ops *ops, char *args, int from_tty)
static void
aix_thread_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal sig)
+ ptid_t ptid, int step, target_signal_t sig)
{
struct thread_info *thread;
pthdb_tid_t tid[2];
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1230,7 +1230,7 @@ amd64_linux_syscall_record (struct regcache *regcache)
int
amd64_linux_record_signal (struct gdbarch *gdbarch,
struct regcache *regcache,
- enum target_signal signal)
+ target_signal_t signal)
{
ULONGEST rsp;
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -397,7 +397,7 @@ bsd_uthread_wait (struct target_ops *ops,
static void
bsd_uthread_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal sig)
+ ptid_t ptid, int step, target_signal_t sig)
{
/* Pass the request to the layer beneath. */
struct target_ops *beneath = find_target_beneath (ops);
--- a/gdb/common/gdb_signals.h
+++ b/gdb/common/gdb_signals.h
@@ -28,29 +28,29 @@
targ_signal SIGNO has an equivalent ``host'' representation. */
/* FIXME: cagney/1999-11-22: The name below was chosen in preference
to the shorter target_signal_p() because it is far less ambigious.
- In this context ``target_signal'' refers to GDB's internal
+ In this context ``target_signal_t'' refers to GDB's internal
representation of the target's set of signals while ``host signal''
refers to the target operating system's signal. Confused? */
-extern int target_signal_to_host_p (enum target_signal signo);
+extern int target_signal_to_host_p (target_signal_t signo);
-/* Convert between host signal numbers and enum target_signal's.
+/* Convert between host signal numbers and target_signal_t's.
target_signal_to_host() returns 0 and prints a warning() on GDB's
console if SIGNO has no equivalent host representation. */
/* FIXME: cagney/1999-11-22: Here ``host'' is used incorrectly, it is
refering to the target operating system's signal numbering.
- Similarly, ``enum target_signal'' is named incorrectly, ``enum
+ Similarly, ``target_signal_t'' is named incorrectly, ``enum
gdb_signal'' would probably be better as it is refering to GDB's
internal representation of a target operating system's signal. */
-extern enum target_signal target_signal_from_host (int);
-extern int target_signal_to_host (enum target_signal);
+extern target_signal_t target_signal_from_host (int);
+extern int target_signal_to_host (target_signal_t);
/* Return the string for a signal. */
-extern const char *target_signal_to_string (enum target_signal);
+extern const char *target_signal_to_string (target_signal_t);
/* Return the name (SIGHUP, etc.) for a signal. */
-extern const char *target_signal_to_name (enum target_signal);
+extern const char *target_signal_to_name (target_signal_t);
/* Given a name (SIGHUP, etc.), return its signal. */
-enum target_signal target_signal_from_name (const char *);
+target_signal_t target_signal_from_name (const char *);
#endif /* COMMON_GDB_SIGNALS_H */
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -48,7 +48,7 @@ struct gdbarch;
# endif
#endif
-/* This table must match in order and size the signals in enum target_signal. */
+/* This table must match in order and size the signals in target_signal_t. */
static const struct {
const char *name;
@@ -65,7 +65,7 @@ static const struct {
/* Return the string for a signal. */
const char *
-target_signal_to_string (enum target_signal sig)
+target_signal_to_string (target_signal_t sig)
{
if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST)
return signals[sig].string;
@@ -75,7 +75,7 @@ target_signal_to_string (enum target_signal sig)
/* Return the name for a signal. */
const char *
-target_signal_to_name (enum target_signal sig)
+target_signal_to_name (target_signal_t sig)
{
if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST
&& signals[sig].name != NULL)
@@ -87,10 +87,10 @@ target_signal_to_name (enum target_signal sig)
}
/* Given a name, return its signal. */
-enum target_signal
+target_signal_t
target_signal_from_name (const char *name)
{
- enum target_signal sig;
+ target_signal_t sig;
/* It's possible we also should allow "SIGCLD" as well as "SIGCHLD"
for TARGET_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more
@@ -100,7 +100,7 @@ target_signal_from_name (const char *name)
/* This ugly cast brought to you by the native VAX compiler. */
for (sig = TARGET_SIGNAL_HUP;
sig < TARGET_SIGNAL_LAST;
- sig = (enum target_signal) ((int) sig + 1))
+ sig = (target_signal_t) ((int) sig + 1))
if (signals[sig].name != NULL
&& strcmp (name, signals[sig].name) == 0)
return sig;
@@ -112,7 +112,7 @@ target_signal_from_name (const char *name)
a file called native-utils.c or unixwaitstatus-utils.c or whatever. */
/* Convert host signal to our signals. */
-enum target_signal
+target_signal_t
target_signal_from_host (int hostsig)
{
/* A switch statement would make sense but would require special kludges
@@ -342,12 +342,12 @@ target_signal_from_host (int hostsig)
{
/* This block of TARGET_SIGNAL_REALTIME value is in order. */
if (33 <= hostsig && hostsig <= 63)
- return (enum target_signal)
+ return (target_signal_t)
(hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
else if (hostsig == 32)
return TARGET_SIGNAL_REALTIME_32;
else if (64 <= hostsig && hostsig <= 127)
- return (enum target_signal)
+ return (target_signal_t)
(hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
else
error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
@@ -357,13 +357,13 @@ target_signal_from_host (int hostsig)
return TARGET_SIGNAL_UNKNOWN;
}
-/* Convert a OURSIG (an enum target_signal) to the form used by the
+/* Convert a OURSIG (an target_signal_t) to the form used by the
target operating system (refered to as the ``host'') or zero if the
equivalent host signal is not available. Set/clear OURSIG_OK
accordingly. */
static int
-do_target_signal_to_host (enum target_signal oursig,
+do_target_signal_to_host (target_signal_t oursig,
int *oursig_ok)
{
int retsig;
@@ -628,7 +628,7 @@ do_target_signal_to_host (enum target_signal oursig,
}
int
-target_signal_to_host_p (enum target_signal oursig)
+target_signal_to_host_p (target_signal_t oursig)
{
int oursig_ok;
do_target_signal_to_host (oursig, &oursig_ok);
@@ -636,7 +636,7 @@ target_signal_to_host_p (enum target_signal oursig)
}
int
-target_signal_to_host (enum target_signal oursig)
+target_signal_to_host (target_signal_t oursig)
{
int oursig_ok;
int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
@@ -662,11 +662,11 @@ target_signal_to_host (enum target_signal oursig)
lenient and allow 1-15 which should match host signal numbers on
most systems. Use of symbolic signal names is strongly encouraged. */
-enum target_signal
+target_signal_t
target_signal_from_command (int num)
{
if (num >= 1 && num <= 15)
- return (enum target_signal) num;
+ return (target_signal_t) num;
error ("Only signals 1-15 are valid as numeric signals.\n\
Use \"info signals\" for a list of symbolic signals.");
}
@@ -681,12 +681,12 @@ _initialize_signals (void)
}
int
-default_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
+default_target_signal_to_host (struct gdbarch *gdbarch, target_signal_t ts)
{
return target_signal_to_host (ts);
}
-enum target_signal
+target_signal_t
default_target_signal_from_host (struct gdbarch *gdbarch, int signo)
{
return target_signal_from_host (signo);
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -431,7 +431,7 @@ core_open (char *filename, int from_tty)
if (siggy > 0)
/* NOTE: target_signal_from_host() converts a target signal value
into gdb's internal signal value. Unfortunately gdb's internal
- value is called ``target_signal'' and this function got the
+ value is called ``target_signal_t'' and this function got the
name ..._from_host(). */
printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
target_signal_to_string (
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -89,9 +89,9 @@ extern boolean_t exc_server (mach_msg_header_t *in, mach_msg_header_t *out);
static void darwin_stop (ptid_t);
static void darwin_resume_to (struct target_ops *ops, ptid_t ptid, int step,
- enum target_signal signal);
+ target_signal_t signal);
static void darwin_resume (ptid_t ptid, int step,
- enum target_signal signal);
+ target_signal_t signal);
static ptid_t darwin_wait_to (struct target_ops *ops, ptid_t ptid,
struct target_waitstatus *status, int options);
@@ -767,7 +767,7 @@ darwin_suspend_inferior_threads (struct inferior *inf)
}
static void
-darwin_resume (ptid_t ptid, int step, enum target_signal signal)
+darwin_resume (ptid_t ptid, int step, target_signal_t signal)
{
struct target_waitstatus status;
int pid;
@@ -833,7 +833,7 @@ darwin_resume (ptid_t ptid, int step, enum target_signal signal)
static void
darwin_resume_to (struct target_ops *ops, ptid_t ptid, int step,
- enum target_signal signal)
+ target_signal_t signal)
{
return darwin_resume (ptid, step, signal);
}
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -64,7 +64,7 @@
#include "gdb_wchar.h"
-/* For ``enum target_signal''. */
+/* For ``target_signal_t''. */
#include "gdb/signals.h"
/* Just in case they're not defined in stdio.h. */
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -152,7 +152,7 @@ find_signalled_thread (struct thread_info *info, void *data)
return 0;
}
-static enum target_signal
+static target_signal_t
find_stop_signal (void)
{
struct thread_info *info =
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -3507,7 +3507,7 @@ gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
}
int
-gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal)
+gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, target_signal_t signal)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->process_record_signal != NULL);
@@ -3523,7 +3523,7 @@ set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
gdbarch->process_record_signal = process_record_signal;
}
-enum target_signal
+target_signal_t
gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
{
gdb_assert (gdbarch != NULL);
@@ -3541,7 +3541,7 @@ set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
}
int
-gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
+gdbarch_target_signal_to_host (struct gdbarch *gdbarch, target_signal_t ts)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->target_signal_to_host != NULL);
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -880,22 +880,22 @@ extern void set_gdbarch_process_record (struct gdbarch *gdbarch, gdbarch_process
extern int gdbarch_process_record_signal_p (struct gdbarch *gdbarch);
-typedef int (gdbarch_process_record_signal_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal);
-extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal);
+typedef int (gdbarch_process_record_signal_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, target_signal_t signal);
+extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, target_signal_t signal);
extern void set_gdbarch_process_record_signal (struct gdbarch *gdbarch, gdbarch_process_record_signal_ftype *process_record_signal);
/* Signal translation: translate inferior's signal (host's) number into
GDB's representation. */
-typedef enum target_signal (gdbarch_target_signal_from_host_ftype) (struct gdbarch *gdbarch, int signo);
-extern enum target_signal gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo);
+typedef target_signal_t (gdbarch_target_signal_from_host_ftype) (struct gdbarch *gdbarch, int signo);
+extern target_signal_t gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo);
extern void set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch, gdbarch_target_signal_from_host_ftype *target_signal_from_host);
/* Signal translation: translate GDB's signal number into inferior's host
signal number. */
-typedef int (gdbarch_target_signal_to_host_ftype) (struct gdbarch *gdbarch, enum target_signal ts);
-extern int gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts);
+typedef int (gdbarch_target_signal_to_host_ftype) (struct gdbarch *gdbarch, target_signal_t ts);
+extern int gdbarch_target_signal_to_host (struct gdbarch *gdbarch, target_signal_t ts);
extern void set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch, gdbarch_target_signal_to_host_ftype *target_signal_to_host);
/* Extra signal info inspection.
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -748,14 +748,14 @@ M:int:process_record:struct regcache *regcache, CORE_ADDR addr:regcache, addr
# Save process state after a signal.
# Return -1 if something goes wrong, 0 otherwise.
-M:int:process_record_signal:struct regcache *regcache, enum target_signal signal:regcache, signal
+M:int:process_record_signal:struct regcache *regcache, target_signal_t signal:regcache, signal
# Signal translation: translate inferior's signal (host's) number into
# GDB's representation.
-m:enum target_signal:target_signal_from_host:int signo:signo::default_target_signal_from_host::0
+m:target_signal_t:target_signal_from_host:int signo:signo::default_target_signal_from_host::0
# Signal translation: translate GDB's signal number into inferior's host
# signal number.
-m:int:target_signal_to_host:enum target_signal ts:ts::default_target_signal_to_host::0
+m:int:target_signal_to_host:target_signal_t ts:ts::default_target_signal_to_host::0
# Extra signal info inspection.
#
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -54,7 +54,7 @@ struct thread_resume
thread. If stopping a thread, and this is 0, the target should
stop the thread however it best decides to (e.g., SIGSTOP on
linux; SuspendThread on win32). This is a host signal value (not
- enum target_signal). */
+ target_signal_t). */
int sig;
};
@@ -98,7 +98,7 @@ struct target_waitstatus
union
{
int integer;
- enum target_signal sig;
+ target_signal_t sig;
ptid_t related_pid;
char *execd_pathname;
}
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -73,7 +73,7 @@ static int attaching = 0;
static HANDLE current_process_handle = NULL;
static DWORD current_process_id = 0;
static DWORD main_thread_id = 0;
-static enum target_signal last_sig = TARGET_SIGNAL_0;
+static target_signal_t last_sig = TARGET_SIGNAL_0;
/* The current debug event from WaitForDebugEvent. */
static DEBUG_EVENT current_event;
@@ -803,7 +803,7 @@ static void
win32_resume (struct thread_resume *resume_info, size_t n)
{
DWORD tid;
- enum target_signal sig;
+ target_signal_t sig;
int step;
win32_thread_info *th;
DWORD continue_status = DBG_CONTINUE;
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -176,7 +176,7 @@ struct thread_info
struct target_waitstatus pending_follow;
/* Last signal that the inferior received (why it stopped). */
- enum target_signal stop_signal;
+ target_signal_t stop_signal;
/* Chain containing status of breakpoint(s) the thread stopped
at. */
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -107,7 +107,7 @@ void inf_resume (struct inf *inf);
void inf_set_step_thread (struct inf *inf, struct proc *proc);
void inf_detach (struct inf *inf);
void inf_attach (struct inf *inf, int pid);
-void inf_signal (struct inf *inf, enum target_signal sig);
+void inf_signal (struct inf *inf, target_signal_t sig);
void inf_continue (struct inf *inf);
#define inf_debug(_inf, msg, args...) \
@@ -1318,7 +1318,7 @@ inf_restore_exc_ports (struct inf *inf)
signal 0, will continue it. INF is assumed to be in a paused state, and
the resume_sc's of INF's threads may be affected. */
void
-inf_signal (struct inf *inf, enum target_signal sig)
+inf_signal (struct inf *inf, target_signal_t sig)
{
error_t err = 0;
int host_sig = target_signal_to_host (sig);
@@ -1965,7 +1965,7 @@ port_msgs_queued (mach_port_t port)
*/
static void
gnu_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal sig)
+ ptid_t ptid, int step, target_signal_t sig)
{
struct proc *step_thread = 0;
int resume_all;
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -238,7 +238,7 @@ static void go32_attach (struct target_ops *ops, char *args, int from_tty);
static void go32_detach (struct target_ops *ops, char *args, int from_tty);
static void go32_resume (struct target_ops *ops,
ptid_t ptid, int step,
- enum target_signal siggnal);
+ target_signal_t siggnal);
static void go32_fetch_registers (struct target_ops *ops,
struct regcache *, int regno);
static void store_register (const struct regcache *, int regno);
@@ -309,7 +309,7 @@ regno_mapping[] =
static struct
{
int go32_sig;
- enum target_signal gdb_sig;
+ target_signal_t gdb_sig;
}
sig_map[] =
{
@@ -343,7 +343,7 @@ sig_map[] =
};
static struct {
- enum target_signal gdb_sig;
+ target_signal_t gdb_sig;
int djgpp_excepno;
} excepn_map[] = {
{TARGET_SIGNAL_0, -1},
@@ -391,7 +391,7 @@ static int resume_signal = -1;
static void
go32_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, target_signal_t siggnal)
{
int i;
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -169,7 +169,7 @@ hpux_thread_detach (struct target_ops *ops, char *args, int from_tty)
static void
hpux_thread_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signo)
+ ptid_t ptid, int step, target_signal_t signo)
{
struct cleanup *old_chain;
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -829,7 +829,7 @@ static const unsigned char linux_syscall[] = { 0xcd, 0x80 };
static void
i386_linux_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signal)
+ ptid_t ptid, int step, target_signal_t signal)
{
int pid = PIDGET (ptid);
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -463,7 +463,7 @@ i386_linux_intx80_sysenter_record (struct regcache *regcache)
int
i386_linux_record_signal (struct gdbarch *gdbarch,
struct regcache *regcache,
- enum target_signal signal)
+ target_signal_t signal)
{
ULONGEST esp;
--- a/gdb/i386fbsd-nat.c
+++ b/gdb/i386fbsd-nat.c
@@ -37,7 +37,7 @@
static void
i386fbsd_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signal)
+ ptid_t ptid, int step, target_signal_t signal)
{
pid_t pid = ptid_get_pid (ptid);
int request = PT_STEP;
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -350,7 +350,7 @@ inf_ptrace_stop (ptid_t ptid)
static void
inf_ptrace_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signal)
+ ptid_t ptid, int step, target_signal_t signal)
{
pid_t pid = ptid_get_pid (ptid);
int request;
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -867,7 +867,7 @@ inf_ttrace_resume_callback (struct thread_info *info, void *arg)
static void
inf_ttrace_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signal)
+ ptid_t ptid, int step, target_signal_t signal)
{
int resume_all;
ttreq_t request = step ? TT_LWP_SINGLE : TT_LWP_CONTINUE;
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1161,7 +1161,7 @@ go_command (char *line_no, int from_tty)
static void
signal_command (char *signum_exp, int from_tty)
{
- enum target_signal oursig;
+ target_signal_t oursig;
int async_exec = 0;
dont_repeat (); /* Too dangerous. */
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -35,7 +35,7 @@ struct terminal_info;
/* For bpstat. */
#include "breakpoint.h"
-/* For enum target_signal. */
+/* For target_signal_t. */
#include "target.h"
/* For struct frame_id. */
@@ -143,7 +143,7 @@ extern int sync_execution;
extern void clear_proceed_status (void);
-extern void proceed (CORE_ADDR, enum target_signal, int);
+extern void proceed (CORE_ADDR, target_signal_t, int);
extern int sched_multi;
@@ -198,7 +198,7 @@ extern void reopen_exec_file (void);
/* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */
-extern void resume (int, enum target_signal);
+extern void resume (int, target_signal_t);
/* From misc files */
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -59,7 +59,7 @@ static void signals_info (char *, int);
static void handle_command (char *, int);
-static void sig_print_info (enum target_signal);
+static void sig_print_info (target_signal_t);
static void sig_print_header (void);
@@ -1297,7 +1297,7 @@ write_memory_ptid (ptid_t ptid, CORE_ADDR memaddr, const gdb_byte *myaddr, int l
}
static void
-displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
+displaced_step_fixup (ptid_t event_ptid, target_signal_t signal)
{
struct cleanup *old_cleanups;
struct displaced_step_inferior_state *displaced
@@ -1538,7 +1538,7 @@ maybe_software_singlestep (struct gdbarch *gdbarch, CORE_ADDR pc)
STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */
void
-resume (int step, enum target_signal sig)
+resume (int step, target_signal_t sig)
{
int should_resume = 1;
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
@@ -1871,7 +1871,7 @@ prepare_to_proceed (int step)
You should call clear_proceed_status before calling proceed. */
void
-proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
+proceed (CORE_ADDR addr, target_signal_t siggnal, int step)
{
struct regcache *regcache;
struct gdbarch *gdbarch;
@@ -3589,7 +3589,7 @@ targets should add new threads to the thread list themselves in non-stop mode.")
if (new_singlestep_pc != singlestep_pc)
{
- enum target_signal stop_signal;
+ target_signal_t stop_signal;
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread,"
@@ -5625,7 +5625,7 @@ Signal Stop\tPrint\tPass to program\tDescription\n"));
}
static void
-sig_print_info (enum target_signal oursig)
+sig_print_info (target_signal_t oursig)
{
const char *name = target_signal_to_name (oursig);
int name_padding = 13 - strlen (name);
@@ -5649,7 +5649,7 @@ handle_command (char *args, int from_tty)
char **argv;
int digits, wordlen;
int sigfirst, signum, siglast;
- enum target_signal oursig;
+ target_signal_t oursig;
int allsigs;
int nsigs;
unsigned char *sigs;
@@ -5769,14 +5769,14 @@ handle_command (char *args, int from_tty)
for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++)
{
- switch ((enum target_signal) signum)
+ switch ((target_signal_t) signum)
{
case TARGET_SIGNAL_TRAP:
case TARGET_SIGNAL_INT:
if (!allsigs && !sigs[signum])
{
if (query (_("%s is used by the debugger.\n\
-Are you sure you want to change it? "), target_signal_to_name ((enum target_signal) signum)))
+Are you sure you want to change it? "), target_signal_to_name ((target_signal_t) signum)))
{
sigs[signum] = 1;
}
@@ -5844,7 +5844,7 @@ xdb_handle_command (char *args, int from_tty)
if (argBuf)
{
int validFlag = 1;
- enum target_signal oursig;
+ target_signal_t oursig;
oursig = target_signal_from_name (argv[0]);
memset (argBuf, 0, bufLen);
@@ -5895,7 +5895,7 @@ xdb_handle_command (char *args, int from_tty)
static void
signals_info (char *signum_exp, int from_tty)
{
- enum target_signal oursig;
+ target_signal_t oursig;
sig_print_header ();
@@ -5917,7 +5917,7 @@ signals_info (char *signum_exp, int from_tty)
/* These ugly casts brought to you by the native VAX compiler. */
for (oursig = TARGET_SIGNAL_FIRST;
(int) oursig < (int) TARGET_SIGNAL_LAST;
- oursig = (enum target_signal) ((int) oursig + 1))
+ oursig = (target_signal_t) ((int) oursig + 1))
{
QUIT;
@@ -6013,7 +6013,7 @@ siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var)
struct inferior_thread_state
{
- enum target_signal stop_signal;
+ target_signal_t stop_signal;
CORE_ADDR stop_pc;
struct regcache *registers;
};
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1581,7 +1581,7 @@ linux_nat_attach (struct target_ops *ops, char *args, int from_tty)
}
else if (WIFSIGNALED (status))
{
- enum target_signal signo;
+ target_signal_t signo;
target_terminal_ours ();
target_mourn_inferior ();
@@ -1617,7 +1617,7 @@ linux_nat_attach (struct target_ops *ops, char *args, int from_tty)
static int
get_pending_status (struct lwp_info *lp, int *status)
{
- enum target_signal signo = TARGET_SIGNAL_0;
+ target_signal_t signo = TARGET_SIGNAL_0;
/* If we paused threads momentarily, we may have stored pending
events in lp->status or lp->waitstatus (see stop_wait_callback),
@@ -1863,7 +1863,7 @@ resume_set_callback (struct lwp_info *lp, void *data)
static void
linux_nat_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signo)
+ ptid_t ptid, int step, target_signal_t signo)
{
sigset_t prev_mask;
struct lwp_info *lp;
@@ -4167,7 +4167,7 @@ find_signalled_thread (struct thread_info *info, void *data)
return 0;
}
-static enum target_signal
+static target_signal_t
find_stop_signal (void)
{
struct thread_info *info =
@@ -4185,7 +4185,7 @@ find_stop_signal (void)
static char *
linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
char *note_data, int *note_size,
- enum target_signal stop_signal)
+ target_signal_t stop_signal)
{
unsigned long lwp = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = target_gdbarch;
@@ -4278,7 +4278,7 @@ struct linux_nat_corefile_thread_data
char *note_data;
int *note_size;
int num_notes;
- enum target_signal stop_signal;
+ target_signal_t stop_signal;
};
/* Called by gdbthread.c once per thread. Records the thread's
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1650,7 +1650,7 @@ thread_db_get_ada_task_ptid (long lwp, long thread)
static void
thread_db_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signo)
+ ptid_t ptid, int step, target_signal_t signo)
{
struct target_ops *beneath = find_target_beneath (ops);
struct thread_db_info *info;
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -928,7 +928,7 @@ monitor_supply_register (struct regcache *regcache, int regno, char *valstr)
static void
monitor_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal sig)
+ ptid_t ptid, int step, target_signal_t sig)
{
/* Some monitors require a different command when starting a program */
monitor_debug ("MON resume\n");
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -952,7 +952,7 @@ procfs_remove_hw_breakpoint (struct gdbarch *gdbarch,
static void
procfs_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signo)
+ ptid_t ptid, int step, target_signal_t signo)
{
int signal_to_pass;
procfs_status status;
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -113,7 +113,7 @@
static void procfs_attach (struct target_ops *, char *, int);
static void procfs_detach (struct target_ops *, char *, int);
static void procfs_resume (struct target_ops *,
- ptid_t, int, enum target_signal);
+ ptid_t, int, target_signal_t);
static void procfs_stop (ptid_t);
static void procfs_files_info (struct target_ops *);
static void procfs_fetch_registers (struct target_ops *,
@@ -4388,7 +4388,7 @@ make_signal_thread_runnable (procinfo *process, procinfo *pi, void *ptr)
static void
procfs_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signo)
+ ptid_t ptid, int step, target_signal_t signo)
{
procinfo *pi, *thread;
int native_signo;
@@ -5641,7 +5641,7 @@ procfs_first_available (void)
static char *
procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
char *note_data, int *note_size,
- enum target_signal stop_signal)
+ target_signal_t stop_signal)
{
struct regcache *regcache = get_thread_regcache (ptid);
gdb_gregset_t gregs;
@@ -5692,7 +5692,7 @@ struct procfs_corefile_thread_data {
bfd *obfd;
char *note_data;
int *note_size;
- enum target_signal stop_signal;
+ target_signal_t stop_signal;
};
static int
@@ -5722,7 +5722,7 @@ find_signalled_thread (struct thread_info *info, void *data)
return 0;
}
-static enum target_signal
+static target_signal_t
find_stop_signal (void)
{
struct thread_info *info =
@@ -5748,7 +5748,7 @@ procfs_make_note_section (bfd *obfd, int *note_size)
struct procfs_corefile_thread_data thread_args;
gdb_byte *auxv;
int auxv_len;
- enum target_signal stop_signal;
+ target_signal_t stop_signal;
if (get_exec_file (0))
{
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -98,7 +98,7 @@ struct record_reg_entry
struct record_end_entry
{
- enum target_signal sigval;
+ target_signal_t sigval;
ULONGEST insn_num;
};
@@ -207,7 +207,7 @@ static struct target_ops record_core_ops;
/* The beneath function pointers. */
static struct target_ops *record_beneath_to_resume_ops;
static void (*record_beneath_to_resume) (struct target_ops *, ptid_t, int,
- enum target_signal);
+ target_signal_t);
static struct target_ops *record_beneath_to_wait_ops;
static ptid_t (*record_beneath_to_wait) (struct target_ops *, ptid_t,
struct target_waitstatus *,
@@ -578,7 +578,7 @@ record_arch_list_cleanups (void *ignore)
record_arch_list, and add it to record_list. */
static int
-record_message (struct regcache *regcache, enum target_signal signal)
+record_message (struct regcache *regcache, target_signal_t signal)
{
int ret;
struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -649,7 +649,7 @@ record_message (struct regcache *regcache, enum target_signal signal)
struct record_message_args {
struct regcache *regcache;
- enum target_signal signal;
+ target_signal_t signal;
};
static int
@@ -662,7 +662,7 @@ record_message_wrapper (void *args)
static int
record_message_wrapper_safe (struct regcache *regcache,
- enum target_signal signal)
+ target_signal_t signal)
{
struct record_message_args args;
@@ -783,7 +783,7 @@ record_exec_insn (struct regcache *regcache, struct gdbarch *gdbarch,
static struct target_ops *tmp_to_resume_ops;
static void (*tmp_to_resume) (struct target_ops *, ptid_t, int,
- enum target_signal);
+ target_signal_t);
static struct target_ops *tmp_to_wait_ops;
static ptid_t (*tmp_to_wait) (struct target_ops *, ptid_t,
struct target_waitstatus *,
@@ -1005,7 +1005,7 @@ static int record_resume_step = 0;
static void
record_resume (struct target_ops *ops, ptid_t ptid, int step,
- enum target_signal signal)
+ target_signal_t signal)
{
record_resume_step = step;
@@ -1746,7 +1746,7 @@ init_record_ops (void)
static void
record_core_resume (struct target_ops *ops, ptid_t ptid, int step,
- enum target_signal signal)
+ target_signal_t signal)
{
record_resume_step = step;
}
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -453,7 +453,7 @@ m32r_close (int quitting)
static void
m32r_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal sig)
+ ptid_t ptid, int step, target_signal_t sig)
{
unsigned long pc_addr, bp_addr, ab_addr;
int ib_breakpoints;
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1744,7 +1744,7 @@ mips_detach (struct target_ops *ops, char *args, int from_tty)
static void
mips_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, target_signal_t siggnal)
{
int err;
@@ -1758,7 +1758,7 @@ mips_resume (struct target_ops *ops,
/* Return the signal corresponding to SIG, where SIG is the number which
the MIPS protocol uses for the signal. */
-static enum target_signal
+static target_signal_t
mips_signal_from_protocol (int sig)
{
/* We allow a few more signals than the IDT board actually returns, on
@@ -1772,7 +1772,7 @@ mips_signal_from_protocol (int sig)
from MIPS signal numbers, not host ones. Our internal numbers
match the MIPS numbers for the signals the board can return, which
are: SIGINT, SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP. */
- return (enum target_signal) sig;
+ return (target_signal_t) sig;
}
/* Set the register designated by REGNO to the value designated by VALUE. */
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -119,7 +119,7 @@ struct sim_inferior_data {
ptid_t remote_sim_ptid;
/* Signal with which to resume. */
- enum target_signal resume_siggnal;
+ target_signal_t resume_siggnal;
/* Flag which indicates whether resume should step or not. */
int resume_step;
@@ -825,7 +825,7 @@ gdbsim_detach (struct target_ops *ops, char *args, int from_tty)
struct resume_data
{
- enum target_signal siggnal;
+ target_signal_t siggnal;
int step;
};
@@ -854,7 +854,7 @@ gdbsim_resume_inferior (struct inferior *inf, void *arg)
static void
gdbsim_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, target_signal_t siggnal)
{
struct resume_data rd;
struct sim_inferior_data *sim_data
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -4384,7 +4384,7 @@ remote_vcont_probe (struct remote_state *rs)
static char *
append_resumption (char *p, char *endp,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, target_signal_t siggnal)
{
struct remote_state *rs = get_remote_state ();
@@ -4427,7 +4427,7 @@ append_resumption (char *p, char *endp,
moment. */
static int
-remote_vcont_resume (ptid_t ptid, int step, enum target_signal siggnal)
+remote_vcont_resume (ptid_t ptid, int step, target_signal_t siggnal)
{
struct remote_state *rs = get_remote_state ();
char *p;
@@ -4495,13 +4495,13 @@ remote_vcont_resume (ptid_t ptid, int step, enum target_signal siggnal)
/* Tell the remote machine to resume. */
-static enum target_signal last_sent_signal = TARGET_SIGNAL_0;
+static target_signal_t last_sent_signal = TARGET_SIGNAL_0;
static int last_sent_step;
static void
remote_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal siggnal)
+ ptid_t ptid, int step, target_signal_t siggnal)
{
struct remote_state *rs = get_remote_state ();
char *buf;
@@ -5155,7 +5155,7 @@ Packet: '%s'\n"),
else
{
event->ws.kind = TARGET_WAITKIND_STOPPED;
- event->ws.value.sig = (enum target_signal)
+ event->ws.value.sig = (target_signal_t)
(((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
}
break;
@@ -5181,7 +5181,7 @@ Packet: '%s'\n"),
{
/* The remote process exited with a signal. */
event->ws.kind = TARGET_WAITKIND_SIGNALLED;
- event->ws.value.sig = (enum target_signal) value;
+ event->ws.value.sig = (target_signal_t) value;
}
/* If no process is specified, assume inferior_ptid. */
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -348,7 +348,7 @@ sol_thread_detach (struct target_ops *ops, char *args, int from_tty)
static void
sol_thread_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal signo)
+ ptid_t ptid, int step, target_signal_t signo)
{
struct cleanup *old_chain;
struct target_ops *beneath = find_target_beneath (ops);
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2407,7 +2407,7 @@ target_pid_to_str (ptid_t ptid)
}
void
-target_resume (ptid_t ptid, int step, enum target_signal signal)
+target_resume (ptid_t ptid, int step, target_signal_t signal)
{
struct target_ops *t;
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -162,7 +162,7 @@ struct target_waitstatus
union
{
int integer;
- enum target_signal sig;
+ target_signal_t sig;
ptid_t related_pid;
char *execd_pathname;
int syscall_number;
@@ -401,7 +401,7 @@ struct target_ops
void (*to_post_attach) (int);
void (*to_detach) (struct target_ops *ops, char *, int);
void (*to_disconnect) (struct target_ops *, char *, int);
- void (*to_resume) (struct target_ops *, ptid_t, int, enum target_signal);
+ void (*to_resume) (struct target_ops *, ptid_t, int, target_signal_t);
ptid_t (*to_wait) (struct target_ops *,
ptid_t, struct target_waitstatus *, int);
void (*to_fetch_registers) (struct target_ops *, struct regcache *, int);
@@ -801,7 +801,7 @@ extern void target_disconnect (char *, int);
the target, or TARGET_SIGNAL_0 for no signal. The caller may not
pass TARGET_SIGNAL_DEFAULT. */
-extern void target_resume (ptid_t ptid, int step, enum target_signal signal);
+extern void target_resume (ptid_t ptid, int step, target_signal_t signal);
/* Wait for process pid to do something. PTID = -1 to wait for any
pid to do something. Return pid of child, or -1 in case of error;
@@ -1589,13 +1589,13 @@ extern int remote_timeout;
extern void store_waitstatus (struct target_waitstatus *, int);
/* These are in common/signals.c, but they're only used by gdb. */
-extern enum target_signal default_target_signal_from_host (struct gdbarch *,
+extern target_signal_t default_target_signal_from_host (struct gdbarch *,
int);
extern int default_target_signal_to_host (struct gdbarch *,
- enum target_signal);
+ target_signal_t);
-/* Convert from a number used in a GDB command to an enum target_signal. */
-extern enum target_signal target_signal_from_command (int);
+/* Convert from a number used in a GDB command to an target_signal_t. */
+extern target_signal_t target_signal_from_command (int);
/* End of files in common/signals.c. */
/* Set the show memory breakpoints mode to show, and installs a cleanup
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -185,7 +185,7 @@ static void cygwin_set_dr (int i, CORE_ADDR addr);
static void cygwin_set_dr7 (unsigned long val);
static unsigned long cygwin_get_dr6 (void);
-static enum target_signal last_sig = TARGET_SIGNAL_0;
+static target_signal_t last_sig = TARGET_SIGNAL_0;
/* Set if a signal was received from the debugged process */
/* Thread information structure used to track information that is
@@ -258,7 +258,7 @@ static const int *mappings;
struct xlate_exception
{
int them;
- enum target_signal us;
+ target_signal_t us;
};
static const struct xlate_exception
@@ -1282,7 +1282,7 @@ fake_create_process (void)
static void
windows_resume (struct target_ops *ops,
- ptid_t ptid, int step, enum target_signal sig)
+ ptid_t ptid, int step, target_signal_t sig)
{
thread_info *th;
DWORD continue_status = DBG_CONTINUE;
--- a/include/gdb/signals.h
+++ b/include/gdb/signals.h
@@ -49,7 +49,7 @@
/* For an explanation of what each signal means, see
target_signal_to_string. */
-enum target_signal
+typedef enum
{
#define SET(symbol, constant, name, string) \
symbol = constant,
@@ -58,6 +58,7 @@ enum target_signal
#include "gdb/signals.def"
#undef ANY
#undef SET
- };
+ }
+target_signal_t;
#endif /* #ifndef GDB_SIGNALS_H */
--- a/sim/common/sim-signal.c
+++ b/sim/common/sim-signal.c
@@ -94,7 +94,7 @@ sim_signal_to_host (SIM_DESC sd, SIM_SIGNAL sig)
#endif
}
-enum target_signal
+target_signal_t
sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL sig)
{
switch (sig)
--- a/sim/common/sim-signal.h
+++ b/sim/common/sim-signal.h
@@ -46,6 +46,6 @@ typedef enum {
} SIM_SIGNAL;
int sim_signal_to_host (SIM_DESC sd, SIM_SIGNAL);
-enum target_signal sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL);
+target_signal_t sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL);
#endif /* SIM_SIGNAL_H */