From 2ea286498fd2ddceaf074bfbc9a2986777ea0396 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 24 May 2012 16:39:15 +0000 Subject: [PATCH] gdb/ 2012-05-24 Pedro Alves PR gdb/7205 Replace target_signal with gdb_signal throughout. gdb/gdbserver/ 2012-05-24 Pedro Alves PR gdb/7205 Replace target_signal with gdb_signal throughout. include/gdb/ 2012-05-24 Pedro Alves PR gdb/7205 Replace target_signal with gdb_signal throughout. sim/common/ 2012-05-24 Pedro Alves PR gdb/7205 Replace target_signal with gdb_signal throughout. --- gdb/ChangeLog | 6 ++++ gdb/aix-thread.c | 6 ++-- gdb/amd64-linux-tdep.c | 2 +- gdb/arch-utils.c | 6 ++-- gdb/arch-utils.h | 2 +- gdb/bsd-uthread.c | 2 +- gdb/common/gdb_signals.h | 24 +++++++------- gdb/common/signals.c | 38 +++++++++++------------ gdb/corelow.c | 14 ++++----- gdb/darwin-nat.c | 14 ++++----- gdb/defs.h | 2 +- gdb/fbsd-nat.c | 2 +- gdb/fork-child.c | 6 ++-- gdb/gdbarch.c | 32 +++++++++---------- gdb/gdbarch.h | 10 +++--- gdb/gdbarch.sh | 4 +-- gdb/gdbserver/ChangeLog | 6 ++++ gdb/gdbserver/linux-low.c | 20 ++++++------ gdb/gdbserver/lynx-low.c | 6 ++-- gdb/gdbserver/nto-low.c | 4 +-- gdb/gdbserver/server.c | 14 ++++----- gdb/gdbserver/spu-low.c | 4 +-- gdb/gdbserver/target.c | 8 ++--- gdb/gdbserver/target.h | 4 +-- gdb/gdbserver/win32-low.c | 4 +-- gdb/gdbthread.h | 2 +- gdb/gnu-nat.c | 14 ++++----- gdb/go32-nat.c | 10 +++--- gdb/i386-linux-nat.c | 4 +-- gdb/i386-linux-tdep.c | 2 +- gdb/i386fbsd-nat.c | 4 +-- gdb/inf-child.c | 4 +-- gdb/inf-ptrace.c | 4 +-- gdb/inf-ttrace.c | 6 ++-- gdb/infcmd.c | 12 +++---- gdb/inferior.h | 8 ++--- gdb/infrun.c | 62 ++++++++++++++++++------------------- gdb/linux-nat.c | 36 ++++++++++----------- gdb/linux-tdep.c | 8 ++--- gdb/linux-tdep.h | 2 +- gdb/linux-thread-db.c | 6 ++-- gdb/monitor.c | 2 +- gdb/nto-procfs.c | 12 +++---- gdb/nto-tdep.c | 6 ++-- gdb/procfs.c | 18 +++++------ gdb/python/py-inferior.c | 2 +- gdb/python/py-signalevent.c | 4 +-- gdb/python/py-stopevent.c | 2 +- gdb/python/py-stopevent.h | 4 +-- gdb/ravenscar-thread.c | 4 +-- gdb/record.c | 16 +++++----- gdb/remote-m32r-sdi.c | 2 +- gdb/remote-mips.c | 8 ++--- gdb/remote-sim.c | 6 ++-- gdb/remote.c | 14 ++++----- gdb/sol-thread.c | 2 +- gdb/target.c | 12 +++---- gdb/target.h | 10 +++--- gdb/windows-nat.c | 8 ++--- include/gdb/ChangeLog | 6 ++++ include/gdb/callback.h | 2 +- include/gdb/signals.h | 4 +-- sim/common/ChangeLog | 6 ++++ sim/common/sim-signal.c | 2 +- sim/common/sim-signal.h | 2 +- 65 files changed, 301 insertions(+), 277 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 45c8605e17..827092c363 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-05-24 Pedro Alves + + PR gdb/7205 + + Replace target_signal with gdb_signal throughout. + 2012-05-24 Pedro Alves PR tui/14159 diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 534f7318ce..4ffe4f6da8 100644 --- 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, enum gdb_signal sig) { struct thread_info *thread; pthdb_tid_t tid[2]; @@ -999,10 +999,10 @@ aix_thread_resume (struct target_ops *ops, if (arch64) ptrace64aix (PTT_CONTINUE, tid[0], 1, - target_signal_to_host (sig), (void *) tid); + gdb_signal_to_host (sig), (void *) tid); else ptrace32 (PTT_CONTINUE, tid[0], (int *) 1, - target_signal_to_host (sig), (void *) tid); + gdb_signal_to_host (sig), (void *) tid); } } diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 22a34644ad..42dc89af32 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1231,7 +1231,7 @@ amd64_linux_syscall_record (struct regcache *regcache) static int amd64_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, - enum target_signal signal) + enum gdb_signal signal) { ULONGEST rsp; diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index c6866a9afd..803ce1ca26 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -793,10 +793,10 @@ default_gen_return_address (struct gdbarch *gdbarch, error (_("This architecture has no method to collect a return address.")); } -enum target_signal -default_target_signal_from_host (struct gdbarch *gdbarch, int signo) +enum gdb_signal +default_gdb_signal_from_host (struct gdbarch *gdbarch, int signo) { - return target_signal_from_host (signo); + return gdb_signal_from_host (signo); } /* */ diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 8f4763559d..1b8fc6f3da 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -172,7 +172,7 @@ extern void default_gen_return_address (struct gdbarch *gdbarch, extern const char *default_auto_charset (void); extern const char *default_auto_wide_charset (void); -extern enum target_signal default_target_signal_from_host (struct gdbarch *, +extern enum gdb_signal default_gdb_signal_from_host (struct gdbarch *, int); #endif diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index ea9831be9b..948af8fb52 100644 --- 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, enum gdb_signal sig) { /* Pass the request to the layer beneath. */ struct target_ops *beneath = find_target_beneath (ops); diff --git a/gdb/common/gdb_signals.h b/gdb/common/gdb_signals.h index 1cc629775d..392915521b 100644 --- a/gdb/common/gdb_signals.h +++ b/gdb/common/gdb_signals.h @@ -22,33 +22,33 @@ #include "gdb/signals.h" -/* Predicate to target_signal_to_host(). Return non-zero if the enum +/* Predicate to gdb_signal_to_host(). Return non-zero if the enum 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 + to the shorter gdb_signal_p() because it is far less ambigious. + In this context ``gdb_signal'' 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 gdb_signal_to_host_p (enum gdb_signal signo); -/* Convert between host signal numbers and enum target_signal's. - target_signal_to_host() returns 0 and prints a warning() on GDB's +/* Convert between host signal numbers and enum gdb_signal's. + gdb_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, ``enum gdb_signal'' 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 enum gdb_signal gdb_signal_from_host (int); +extern int gdb_signal_to_host (enum gdb_signal); /* Return the string for a signal. */ -extern const char *target_signal_to_string (enum target_signal); +extern const char *gdb_signal_to_string (enum gdb_signal); /* Return the name (SIGHUP, etc.) for a signal. */ -extern const char *target_signal_to_name (enum target_signal); +extern const char *gdb_signal_to_name (enum gdb_signal); /* Given a name (SIGHUP, etc.), return its signal. */ -enum target_signal target_signal_from_name (const char *); +enum gdb_signal gdb_signal_from_name (const char *); #endif /* COMMON_GDB_SIGNALS_H */ diff --git a/gdb/common/signals.c b/gdb/common/signals.c index 2e82e9cc15..46ae5760a8 100644 --- a/gdb/common/signals.c +++ b/gdb/common/signals.c @@ -47,7 +47,7 @@ struct gdbarch; #endif /* This table must match in order and size the signals in enum - target_signal. */ + gdb_signal. */ static const struct { const char *name; @@ -62,7 +62,7 @@ static const struct { /* Return the string for a signal. */ const char * -target_signal_to_string (enum target_signal sig) +gdb_signal_to_string (enum gdb_signal sig) { if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST) return signals[sig].string; @@ -72,7 +72,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) +gdb_signal_to_name (enum gdb_signal sig) { if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST && signals[sig].name != NULL) @@ -84,10 +84,10 @@ target_signal_to_name (enum target_signal sig) } /* Given a name, return its signal. */ -enum target_signal -target_signal_from_name (const char *name) +enum gdb_signal +gdb_signal_from_name (const char *name) { - enum target_signal sig; + enum gdb_signal sig; /* It's possible we also should allow "SIGCLD" as well as "SIGCHLD" for TARGET_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more @@ -97,7 +97,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 = (enum gdb_signal) ((int) sig + 1)) if (signals[sig].name != NULL && strcmp (name, signals[sig].name) == 0) return sig; @@ -109,8 +109,8 @@ 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_from_host (int hostsig) +enum gdb_signal +gdb_signal_from_host (int hostsig) { /* A switch statement would make sense but would require special kludges to deal with the cases where more than one signal has the same number. */ @@ -339,15 +339,15 @@ 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 (enum gdb_signal) (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 (enum gdb_signal) (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64); else - error (_("GDB bug: target.c (target_signal_from_host): " + error (_("GDB bug: target.c (gdb_signal_from_host): " "unrecognized real-time signal")); } #endif @@ -355,13 +355,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 enum gdb_signal) 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_gdb_signal_to_host (enum gdb_signal oursig, int *oursig_ok) { int retsig; @@ -626,24 +626,24 @@ do_target_signal_to_host (enum target_signal oursig, } int -target_signal_to_host_p (enum target_signal oursig) +gdb_signal_to_host_p (enum gdb_signal oursig) { int oursig_ok; - do_target_signal_to_host (oursig, &oursig_ok); + do_gdb_signal_to_host (oursig, &oursig_ok); return oursig_ok; } int -target_signal_to_host (enum target_signal oursig) +gdb_signal_to_host (enum gdb_signal oursig) { int oursig_ok; - int targ_signo = do_target_signal_to_host (oursig, &oursig_ok); + int targ_signo = do_gdb_signal_to_host (oursig, &oursig_ok); if (!oursig_ok) { /* The user might be trying to do "signal SIGSAK" where this system doesn't have SIGSAK. */ warning (_("Signal %s does not exist on this system."), - target_signal_to_name (oursig)); + gdb_signal_to_name (oursig)); return 0; } else diff --git a/gdb/corelow.c b/gdb/corelow.c index aa344c67d9..f566b2d89b 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -440,17 +440,17 @@ core_open (char *filename, int from_tty) siggy = bfd_core_file_failing_signal (core_bfd); if (siggy > 0) { - /* NOTE: target_signal_from_host() converts a target signal + /* NOTE: gdb_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 + internal value is called ``gdb_signal'' and this function got the name ..._from_host(). */ - enum target_signal sig = (core_gdbarch != NULL - ? gdbarch_target_signal_from_host (core_gdbarch, - siggy) - : target_signal_from_host (siggy)); + enum gdb_signal sig = (core_gdbarch != NULL + ? gdbarch_gdb_signal_from_host (core_gdbarch, + siggy) + : gdb_signal_from_host (siggy)); printf_filtered (_("Program terminated with signal %d, %s.\n"), - siggy, target_signal_to_string (sig)); + siggy, gdb_signal_to_string (sig)); } /* Fetch all registers from core file. */ diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index b5bf7cc8ca..54b1f26b9a 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -91,9 +91,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); + enum gdb_signal signal); static void darwin_resume (ptid_t ptid, int step, - enum target_signal signal); + enum gdb_signal signal); static ptid_t darwin_wait_to (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options); @@ -787,7 +787,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, enum gdb_signal signal) { struct target_waitstatus status; int pid; @@ -804,7 +804,7 @@ darwin_resume (ptid_t ptid, int step, enum target_signal signal) if (signal == TARGET_SIGNAL_0) nsignal = 0; else - nsignal = target_signal_to_host (signal); + nsignal = gdb_signal_to_host (signal); /* Don't try to single step all threads. */ if (step) @@ -853,7 +853,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) + enum gdb_signal signal) { return darwin_resume (ptid, step, signal); } @@ -913,10 +913,10 @@ darwin_decode_message (mach_msg_header_t *hdr, if (thread->event.ex_data[0] == EXC_SOFT_SIGNAL) { status->value.sig = - target_signal_from_host (thread->event.ex_data[1]); + gdb_signal_from_host (thread->event.ex_data[1]); inferior_debug (5, _(" (signal %d: %s)\n"), thread->event.ex_data[1], - target_signal_to_name (status->value.sig)); + gdb_signal_to_name (status->value.sig)); /* If the thread is stopped because it has received a signal that gdb has just sent, continue. */ diff --git a/gdb/defs.h b/gdb/defs.h index 229ad1b703..03092aaf69 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -67,7 +67,7 @@ #include "gdb_wchar.h" -/* For ``enum target_signal''. */ +/* For ``enum gdb_signal''. */ #include "gdb/signals.h" /* Just in case they're not defined in stdio.h. */ diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 6a69b39750..336dac5cac 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -149,7 +149,7 @@ find_signalled_thread (struct thread_info *info, void *data) return 0; } -static enum target_signal +static enum gdb_signal find_stop_signal (void) { struct thread_info *info = diff --git a/gdb/fork-child.c b/gdb/fork-child.c index 3b8da49ef8..43fa38828d 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -431,7 +431,7 @@ startup_inferior (int ntraps) while (1) { - enum target_signal resume_signal = TARGET_SIGNAL_0; + enum gdb_signal resume_signal = TARGET_SIGNAL_0; ptid_t event_ptid; struct target_waitstatus ws; @@ -458,8 +458,8 @@ startup_inferior (int ntraps) target_terminal_ours (); target_mourn_inferior (); error (_("During startup program terminated with signal %s, %s."), - target_signal_to_name (ws.value.sig), - target_signal_to_string (ws.value.sig)); + gdb_signal_to_name (ws.value.sig), + gdb_signal_to_string (ws.value.sig)); return; case TARGET_WAITKIND_EXITED: diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 8d009f344d..1287485e20 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -260,7 +260,7 @@ struct gdbarch int sofun_address_maybe_missing; gdbarch_process_record_ftype *process_record; gdbarch_process_record_signal_ftype *process_record_signal; - gdbarch_target_signal_from_host_ftype *target_signal_from_host; + gdbarch_gdb_signal_from_host_ftype *gdb_signal_from_host; gdbarch_get_siginfo_type_ftype *get_siginfo_type; gdbarch_record_special_symbol_ftype *record_special_symbol; gdbarch_get_syscall_number_ftype *get_syscall_number; @@ -427,7 +427,7 @@ struct gdbarch startup_gdbarch = 0, /* sofun_address_maybe_missing */ 0, /* process_record */ 0, /* process_record_signal */ - default_target_signal_from_host, /* target_signal_from_host */ + default_gdb_signal_from_host, /* gdb_signal_from_host */ 0, /* get_siginfo_type */ 0, /* record_special_symbol */ 0, /* get_syscall_number */ @@ -536,7 +536,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->displaced_step_free_closure = NULL; gdbarch->displaced_step_location = NULL; gdbarch->relocate_instruction = NULL; - gdbarch->target_signal_from_host = default_target_signal_from_host; + gdbarch->gdb_signal_from_host = default_gdb_signal_from_host; gdbarch->has_shared_address_space = default_has_shared_address_space; gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at; gdbarch->auto_charset = default_auto_charset; @@ -727,7 +727,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */ /* Skip verify of process_record, has predicate. */ /* Skip verify of process_record_signal, has predicate. */ - /* Skip verify of target_signal_from_host, invalid_p == 0 */ + /* Skip verify of gdb_signal_from_host, invalid_p == 0 */ /* Skip verify of get_siginfo_type, has predicate. */ /* Skip verify of record_special_symbol, has predicate. */ /* Skip verify of get_syscall_number, has predicate. */ @@ -995,6 +995,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: gcore_bfd_target = %s\n", pstring (gdbarch->gcore_bfd_target)); + fprintf_unfiltered (file, + "gdbarch_dump: gdb_signal_from_host = <%s>\n", + host_address_to_string (gdbarch->gdb_signal_from_host)); fprintf_unfiltered (file, "gdbarch_dump: gen_return_address = <%s>\n", host_address_to_string (gdbarch->gen_return_address)); @@ -1337,9 +1340,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: target_desc = %s\n", host_address_to_string (gdbarch->target_desc)); - fprintf_unfiltered (file, - "gdbarch_dump: target_signal_from_host = <%s>\n", - host_address_to_string (gdbarch->target_signal_from_host)); fprintf_unfiltered (file, "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n", gdbarch_unwind_pc_p (gdbarch)); @@ -3771,7 +3771,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, enum gdb_signal signal) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->process_record_signal != NULL); @@ -3787,21 +3787,21 @@ set_gdbarch_process_record_signal (struct gdbarch *gdbarch, gdbarch->process_record_signal = process_record_signal; } -enum target_signal -gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo) +enum gdb_signal +gdbarch_gdb_signal_from_host (struct gdbarch *gdbarch, int signo) { gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->target_signal_from_host != NULL); + gdb_assert (gdbarch->gdb_signal_from_host != NULL); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n"); - return gdbarch->target_signal_from_host (gdbarch, signo); + fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_from_host called\n"); + return gdbarch->gdb_signal_from_host (gdbarch, signo); } void -set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch, - gdbarch_target_signal_from_host_ftype target_signal_from_host) +set_gdbarch_gdb_signal_from_host (struct gdbarch *gdbarch, + gdbarch_gdb_signal_from_host_ftype gdb_signal_from_host) { - gdbarch->target_signal_from_host = target_signal_from_host; + gdbarch->gdb_signal_from_host = gdb_signal_from_host; } int diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 4388a7d572..582bae6338 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -935,16 +935,16 @@ 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, enum gdb_signal signal); +extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal 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); -extern void set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch, gdbarch_target_signal_from_host_ftype *target_signal_from_host); +typedef enum gdb_signal (gdbarch_gdb_signal_from_host_ftype) (struct gdbarch *gdbarch, int signo); +extern enum gdb_signal gdbarch_gdb_signal_from_host (struct gdbarch *gdbarch, int signo); +extern void set_gdbarch_gdb_signal_from_host (struct gdbarch *gdbarch, gdbarch_gdb_signal_from_host_ftype *gdb_signal_from_host); /* Extra signal info inspection. diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 9394677afd..273c87a2bd 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -770,11 +770,11 @@ 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, enum gdb_signal 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:enum gdb_signal:gdb_signal_from_host:int signo:signo::default_gdb_signal_from_host::0 # Extra signal info inspection. # diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 1976a42efd..ed146ebfd4 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2012-05-24 Pedro Alves + + PR gdb/7205 + + Replace target_signal with gdb_signal throughout. + 2012-05-22 Maciej W. Rozycki * linux-low.c (linux_store_registers): Avoid the copying sequence diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 5fe19fdf72..e3c6ed6766 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -1062,7 +1062,7 @@ linux_kill (int pid) static int get_detach_signal (struct thread_info *thread) { - enum target_signal signo = TARGET_SIGNAL_0; + enum gdb_signal signo = TARGET_SIGNAL_0; int status; struct lwp_info *lp = get_thread_lwp (thread); @@ -1102,7 +1102,7 @@ get_detach_signal (struct thread_info *thread) return 0; } - signo = target_signal_from_host (WSTOPSIG (status)); + signo = gdb_signal_from_host (WSTOPSIG (status)); if (program_signals_p && !program_signals[signo]) { @@ -1110,7 +1110,7 @@ get_detach_signal (struct thread_info *thread) fprintf (stderr, "GPS: lwp %s had signal %s, but it is in nopass state\n", target_pid_to_str (ptid_of (lp)), - target_signal_to_string (signo)); + gdb_signal_to_string (signo)); return 0; } else if (!program_signals_p @@ -1124,7 +1124,7 @@ get_detach_signal (struct thread_info *thread) "GPS: lwp %s had signal %s, " "but we don't know if we should pass it. Default to not.\n", target_pid_to_str (ptid_of (lp)), - target_signal_to_string (signo)); + gdb_signal_to_string (signo)); return 0; } else @@ -1133,7 +1133,7 @@ get_detach_signal (struct thread_info *thread) fprintf (stderr, "GPS: lwp %s has pending signal %s: delivering it.\n", target_pid_to_str (ptid_of (lp)), - target_signal_to_string (signo)); + gdb_signal_to_string (signo)); return WSTOPSIG (status); } @@ -2265,7 +2265,7 @@ linux_stabilize_threads (void) if (ourstatus.value.sig != TARGET_SIGNAL_0 || current_inferior->last_resume_kind == resume_stop) { - wstat = W_STOPCODE (target_signal_to_host (ourstatus.value.sig)); + wstat = W_STOPCODE (gdb_signal_to_host (ourstatus.value.sig)); enqueue_one_deferred_signal (lwp, &wstat); } } @@ -2386,7 +2386,7 @@ retry: else { ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = target_signal_from_host (WTERMSIG (w)); + ourstatus->value.sig = gdb_signal_from_host (WTERMSIG (w)); if (debug_threads) fprintf (stderr, @@ -2585,7 +2585,7 @@ Check if we're already there.\n", || WSTOPSIG (w) == __SIGRTMIN + 1)) || #endif - (pass_signals[target_signal_from_host (WSTOPSIG (w))] + (pass_signals[gdb_signal_from_host (WSTOPSIG (w))] && !(WSTOPSIG (w) == SIGSTOP && current_inferior->last_resume_kind == resume_stop)))) { @@ -2738,11 +2738,11 @@ Check if we're already there.\n", { /* A thread that has been requested to stop by GDB with vCont;t, but, it stopped for other reasons. */ - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (w)); + ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (w)); } else { - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (w)); + ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (w)); } gdb_assert (ptid_equal (step_over_bkpt, null_ptid)); diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c index aaed07d66a..2c6ed14c93 100644 --- a/gdb/gdbserver/lynx-low.c +++ b/gdb/gdbserver/lynx-low.c @@ -450,7 +450,7 @@ retry: if (WIFSTOPPED (wstat)) { status->kind = TARGET_WAITKIND_STOPPED; - status->value.integer = target_signal_from_host (WSTOPSIG (wstat)); + status->value.integer = gdb_signal_from_host (WSTOPSIG (wstat)); lynx_debug ("process stopped with signal: %d", status->value.integer); } @@ -463,7 +463,7 @@ retry: else if (WIFSIGNALED (wstat)) { status->kind = TARGET_WAITKIND_SIGNALLED; - status->value.integer = target_signal_from_host (WTERMSIG (wstat)); + status->value.integer = gdb_signal_from_host (WTERMSIG (wstat)); lynx_debug ("process terminated with code: %d", status->value.integer); } @@ -473,7 +473,7 @@ retry: in fact get here. But if we do, handle the event the best we can. */ status->kind = TARGET_WAITKIND_STOPPED; - status->value.integer = target_signal_from_host (0); + status->value.integer = gdb_signal_from_host (0); lynx_debug ("unknown event ????"); } diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c index bfff8250e4..22cd612802 100644 --- a/gdb/gdbserver/nto-low.c +++ b/gdb/gdbserver/nto-low.c @@ -550,7 +550,7 @@ nto_wait (ptid_t ptid, TRACE (" SIGNALLED\n"); ourstatus->kind = TARGET_WAITKIND_STOPPED; ourstatus->value.sig = - target_signal_from_host (status.info.si_signo); + gdb_signal_from_host (status.info.si_signo); nto_inferior.exit_signo = ourstatus->value.sig; break; case _DEBUG_WHY_FAULTED: @@ -564,7 +564,7 @@ nto_wait (ptid_t ptid, else { ourstatus->value.sig = - target_signal_from_host (status.info.si_signo); + gdb_signal_from_host (status.info.si_signo); nto_inferior.exit_signo = ourstatus->value.sig; } break; diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index b3d1b41186..9b8107eca9 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -1935,9 +1935,9 @@ handle_v_cont (char *own_buf) goto err; p = q; - if (!target_signal_to_host_p (sig)) + if (!gdb_signal_to_host_p (sig)) goto err; - resume_info[i].sig = target_signal_to_host (sig); + resume_info[i].sig = gdb_signal_to_host (sig); } else { @@ -3213,8 +3213,8 @@ process_serial_event (void) case 'C': require_running (own_buf); convert_ascii_to_int (own_buf + 1, &sig, 1); - if (target_signal_to_host_p (sig)) - signal = target_signal_to_host (sig); + if (gdb_signal_to_host_p (sig)) + signal = gdb_signal_to_host (sig); else signal = 0; myresume (own_buf, 0, signal); @@ -3222,8 +3222,8 @@ process_serial_event (void) case 'S': require_running (own_buf); convert_ascii_to_int (own_buf + 1, &sig, 1); - if (target_signal_to_host_p (sig)) - signal = target_signal_to_host (sig); + if (gdb_signal_to_host_p (sig)) + signal = gdb_signal_to_host (sig); else signal = 0; myresume (own_buf, 1, signal); @@ -3476,7 +3476,7 @@ handle_target_event (int err, gdb_client_data client_data) resume_info.thread = last_ptid; resume_info.kind = resume_continue; - resume_info.sig = target_signal_to_host (last_status.value.sig); + resume_info.sig = gdb_signal_to_host (last_status.value.sig); (*the_target->resume) (&resume_info, 1); } else if (debug_threads) diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c index 1ecd60ccc5..f3a564587e 100644 --- a/gdb/gdbserver/spu-low.c +++ b/gdb/gdbserver/spu-low.c @@ -455,7 +455,7 @@ spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) { fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = target_signal_from_host (WTERMSIG (w)); + ourstatus->value.sig = gdb_signal_from_host (WTERMSIG (w)); clear_inferiors (); return pid_to_ptid (ret); } @@ -470,7 +470,7 @@ spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) } ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (w)); + ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (w)); return ptid_build (ret, ret, 0); } diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c index 998d6c1f23..753947647c 100644 --- a/gdb/gdbserver/target.c +++ b/gdb/gdbserver/target.c @@ -87,8 +87,8 @@ mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options, "\nChild exited with status %d\n", ourstatus->value.integer); else if (ourstatus->kind == TARGET_WAITKIND_SIGNALLED) fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n", - target_signal_to_host (ourstatus->value.sig), - target_signal_to_name (ourstatus->value.sig)); + gdb_signal_to_host (ourstatus->value.sig), + gdb_signal_to_name (ourstatus->value.sig)); if (connected_wait) server_waiting = 0; @@ -157,11 +157,11 @@ target_waitstatus_to_string (const struct target_waitstatus *ws) break; case TARGET_WAITKIND_STOPPED: sprintf (buf, "%sstopped, signal = %s", - kind_str, target_signal_to_name (ws->value.sig)); + kind_str, gdb_signal_to_name (ws->value.sig)); break; case TARGET_WAITKIND_SIGNALLED: sprintf (buf, "%ssignalled, signal = %s", - kind_str, target_signal_to_name (ws->value.sig)); + kind_str, gdb_signal_to_name (ws->value.sig)); break; case TARGET_WAITKIND_LOADED: sprintf (buf, "%sloaded", kind_str); diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index dcf02306c8..0cf5687f20 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -53,7 +53,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). */ + enum gdb_signal). */ int sig; }; @@ -97,7 +97,7 @@ struct target_waitstatus union { int integer; - enum target_signal sig; + enum gdb_signal sig; ptid_t related_pid; char *execd_pathname; } diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index 315d4498ad..86e7e35724 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -74,7 +74,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 enum gdb_signal last_sig = TARGET_SIGNAL_0; /* The current debug event from WaitForDebugEvent. */ static DEBUG_EVENT current_event; @@ -806,7 +806,7 @@ static void win32_resume (struct thread_resume *resume_info, size_t n) { DWORD tid; - enum target_signal sig; + enum gdb_signal sig; int step; win32_thread_info *th; DWORD continue_status = DBG_CONTINUE; diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index fb8de161e1..25123574e3 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -123,7 +123,7 @@ struct thread_control_state struct thread_suspend_state { /* Last signal that the inferior received (why it stopped). */ - enum target_signal stop_signal; + enum gdb_signal stop_signal; }; struct thread_info diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 17b0a45e6f..d4c5457662 100644 --- 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, enum gdb_signal sig); void inf_continue (struct inf *inf); #define inf_debug(_inf, msg, args...) \ @@ -1321,12 +1321,12 @@ 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, enum gdb_signal sig) { error_t err = 0; - int host_sig = target_signal_to_host (sig); + int host_sig = gdb_signal_to_host (sig); -#define NAME target_signal_to_name (sig) +#define NAME gdb_signal_to_name (sig) if (host_sig >= _NSIG) /* A mach exception. Exceptions are encoded in the signal space by @@ -1728,7 +1728,7 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port, them after _NSIG; this assumes they're positive (and not extremely large)! */ inf->wait.status.value.sig = - target_signal_from_host (_NSIG + exception); + gdb_signal_from_host (_NSIG + exception); } } else @@ -1975,7 +1975,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, enum gdb_signal sig) { struct proc *step_thread = 0; int resume_all; @@ -2000,7 +2000,7 @@ gnu_resume (struct target_ops *ops, proc_abort (inf->wait.thread, 1); warning (_("Aborting %s with unforwarded exception %s."), proc_string (inf->wait.thread), - target_signal_to_name (inf->wait.status.value.sig)); + gdb_signal_to_name (inf->wait.status.value.sig)); } if (port_msgs_queued (inf->event_port)) diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index fe575d52a4..1602dad90e 100644 --- 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); + enum gdb_signal 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; + enum gdb_signal gdb_sig; } sig_map[] = { @@ -343,7 +343,7 @@ sig_map[] = }; static struct { - enum target_signal gdb_sig; + enum gdb_signal 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, enum gdb_signal siggnal) { int i; @@ -408,7 +408,7 @@ go32_resume (struct target_ops *ops, } if (resume_signal == -1) printf_unfiltered ("Cannot deliver signal %s on this platform.\n", - target_signal_to_name (siggnal)); + gdb_signal_to_name (siggnal)); } } diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index ac1629ac79..5a65ef6a2f 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -875,7 +875,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, enum gdb_signal signal) { int pid = PIDGET (ptid); @@ -938,7 +938,7 @@ i386_linux_resume (struct target_ops *ops, } } - if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1) + if (ptrace (request, pid, 0, gdb_signal_to_host (signal)) == -1) perror_with_name (("ptrace")); } diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index bee4a6d5dd..8475d7a8e1 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -462,7 +462,7 @@ i386_linux_intx80_sysenter_syscall_record (struct regcache *regcache) static int i386_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, - enum target_signal signal) + enum gdb_signal signal) { ULONGEST esp; diff --git a/gdb/i386fbsd-nat.c b/gdb/i386fbsd-nat.c index d9c2a96845..60966e93c6 100644 --- a/gdb/i386fbsd-nat.c +++ b/gdb/i386fbsd-nat.c @@ -36,7 +36,7 @@ static void i386fbsd_resume (struct target_ops *ops, - ptid_t ptid, int step, enum target_signal signal) + ptid_t ptid, int step, enum gdb_signal signal) { pid_t pid = ptid_get_pid (ptid); int request = PT_STEP; @@ -75,7 +75,7 @@ i386fbsd_resume (struct target_ops *ops, was. (If GDB wanted it to start some other way, we have already written a new PC value to the child.) */ if (ptrace (request, pid, (caddr_t) 1, - target_signal_to_host (signal)) == -1) + gdb_signal_to_host (signal)) == -1) perror_with_name (("ptrace")); } diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 08955eaec2..54e65c5fba 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -53,12 +53,12 @@ store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus) else if (!WIFSTOPPED (hoststatus)) { ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = target_signal_from_host (WTERMSIG (hoststatus)); + ourstatus->value.sig = gdb_signal_from_host (WTERMSIG (hoststatus)); } else { ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (hoststatus)); + ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (hoststatus)); } } diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index fc8ab87c5d..0924d77ee2 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -342,7 +342,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, enum gdb_signal signal) { pid_t pid = ptid_get_pid (ptid); int request; @@ -371,7 +371,7 @@ inf_ptrace_resume (struct target_ops *ops, where it was. If GDB wanted it to start some other way, we have already written a new program counter value to the child. */ errno = 0; - ptrace (request, pid, (PTRACE_TYPE_ARG3)1, target_signal_to_host (signal)); + ptrace (request, pid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal)); if (errno != 0) perror_with_name (("ptrace")); } diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index e82309d672..a13e7496bf 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -904,11 +904,11 @@ 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, enum gdb_signal signal) { int resume_all; ttreq_t request = step ? TT_LWP_SINGLE : TT_LWP_CONTINUE; - int sig = target_signal_to_host (signal); + int sig = gdb_signal_to_host (signal); struct thread_info *info; /* A specific PTID means `step only this process id'. */ @@ -1126,7 +1126,7 @@ inf_ttrace_wait (struct target_ops *ops, case TTEVT_SIGNAL: ourstatus->kind = TARGET_WAITKIND_STOPPED; ourstatus->value.sig = - target_signal_from_host (tts.tts_u.tts_signal.tts_signo); + gdb_signal_from_host (tts.tts_u.tts_signal.tts_signo); break; case TTEVT_SYSCALL_ENTRY: diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 1f7564aefb..2f7ac053a8 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1198,7 +1198,7 @@ go_command (char *line_no, int from_tty) static void signal_command (char *signum_exp, int from_tty) { - enum target_signal oursig; + enum gdb_signal oursig; int async_exec = 0; dont_repeat (); /* Too dangerous. */ @@ -1230,7 +1230,7 @@ signal_command (char *signum_exp, int from_tty) /* It would be even slicker to make signal names be valid expressions, (the type could be "enum $signal" or some such), then the user could assign them to convenience variables. */ - oursig = target_signal_from_name (signum_exp); + oursig = gdb_signal_from_name (signum_exp); if (oursig == TARGET_SIGNAL_UNKNOWN) { @@ -1240,7 +1240,7 @@ signal_command (char *signum_exp, int from_tty) if (num == 0) oursig = TARGET_SIGNAL_0; else - oursig = target_signal_from_command (num); + oursig = gdb_signal_from_command (num); } if (from_tty) @@ -1249,7 +1249,7 @@ signal_command (char *signum_exp, int from_tty) printf_filtered (_("Continuing with no signal.\n")); else printf_filtered (_("Continuing with signal %s.\n"), - target_signal_to_name (oursig)); + gdb_signal_to_name (oursig)); } clear_proceed_status (); @@ -1831,8 +1831,8 @@ program_info (char *args, int from_tty) else if (tp->suspend.stop_signal != TARGET_SIGNAL_0) { printf_filtered (_("It stopped with signal %s, %s.\n"), - target_signal_to_name (tp->suspend.stop_signal), - target_signal_to_string (tp->suspend.stop_signal)); + gdb_signal_to_name (tp->suspend.stop_signal), + gdb_signal_to_string (tp->suspend.stop_signal)); } if (!from_tty) diff --git a/gdb/inferior.h b/gdb/inferior.h index 24916f5908..fc3b6d4081 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -36,7 +36,7 @@ struct terminal_info; /* For bpstat. */ #include "breakpoint.h" -/* For enum target_signal. */ +/* For enum gdb_signal. */ #include "target.h" /* For struct frame_id. */ @@ -102,7 +102,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, enum gdb_signal, int); extern int sched_multi; @@ -159,7 +159,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, enum gdb_signal); extern ptid_t user_visible_resume_ptid (int step); @@ -640,6 +640,6 @@ extern void update_signals_program_target (void); 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_from_command (int num); +enum gdb_signal gdb_signal_from_command (int num); #endif /* !defined (INFERIOR_H) */ diff --git a/gdb/infrun.c b/gdb/infrun.c index 81b6f5cb4a..81aa8baee9 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -64,7 +64,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 (enum gdb_signal); static void sig_print_header (void); @@ -90,11 +90,11 @@ static int prepare_to_proceed (int); static void print_exited_reason (int exitstatus); -static void print_signal_exited_reason (enum target_signal siggnal); +static void print_signal_exited_reason (enum gdb_signal siggnal); static void print_no_history_reason (void); -static void print_signal_received_reason (enum target_signal siggnal); +static void print_signal_received_reason (enum gdb_signal siggnal); static void print_end_stepping_range_reason (void); @@ -1433,7 +1433,7 @@ displaced_step_restore (struct displaced_step_inferior_state *displaced, } static void -displaced_step_fixup (ptid_t event_ptid, enum target_signal signal) +displaced_step_fixup (ptid_t event_ptid, enum gdb_signal signal) { struct cleanup *old_cleanups; struct displaced_step_inferior_state *displaced @@ -1705,7 +1705,7 @@ user_visible_resume_ptid (int step) 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, enum gdb_signal sig) { int should_resume = 1; struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); @@ -2110,7 +2110,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, enum gdb_signal siggnal, int step) { struct regcache *regcache; struct gdbarch *gdbarch; @@ -3916,7 +3916,7 @@ handle_inferior_event (struct execution_control_state *ecs) if (new_singlestep_pc != singlestep_pc) { - enum target_signal stop_signal; + enum gdb_signal stop_signal; if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread," @@ -5806,7 +5806,7 @@ print_end_stepping_range_reason (void) /* The inferior was terminated by a signal, print why it stopped. */ static void -print_signal_exited_reason (enum target_signal siggnal) +print_signal_exited_reason (enum gdb_signal siggnal) { struct ui_out *uiout = current_uiout; @@ -5817,12 +5817,12 @@ print_signal_exited_reason (enum target_signal siggnal) ui_out_text (uiout, "\nProgram terminated with signal "); annotate_signal_name (); ui_out_field_string (uiout, "signal-name", - target_signal_to_name (siggnal)); + gdb_signal_to_name (siggnal)); annotate_signal_name_end (); ui_out_text (uiout, ", "); annotate_signal_string (); ui_out_field_string (uiout, "signal-meaning", - target_signal_to_string (siggnal)); + gdb_signal_to_string (siggnal)); annotate_signal_string_end (); ui_out_text (uiout, ".\n"); ui_out_text (uiout, "The program no longer exists.\n"); @@ -5870,7 +5870,7 @@ print_exited_reason (int exitstatus) tells us to print about it. */ static void -print_signal_received_reason (enum target_signal siggnal) +print_signal_received_reason (enum gdb_signal siggnal) { struct ui_out *uiout = current_uiout; @@ -5894,12 +5894,12 @@ print_signal_received_reason (enum target_signal siggnal) ui_out_field_string (uiout, "reason", async_reason_lookup (EXEC_ASYNC_SIGNAL_RECEIVED)); ui_out_field_string (uiout, "signal-name", - target_signal_to_name (siggnal)); + gdb_signal_to_name (siggnal)); annotate_signal_name_end (); ui_out_text (uiout, ", "); annotate_signal_string (); ui_out_field_string (uiout, "signal-meaning", - target_signal_to_string (siggnal)); + gdb_signal_to_string (siggnal)); annotate_signal_string_end (); } ui_out_text (uiout, ".\n"); @@ -6258,9 +6258,9 @@ sig_print_header (void) } static void -sig_print_info (enum target_signal oursig) +sig_print_info (enum gdb_signal oursig) { - const char *name = target_signal_to_name (oursig); + const char *name = gdb_signal_to_name (oursig); int name_padding = 13 - strlen (name); if (name_padding <= 0) @@ -6271,7 +6271,7 @@ sig_print_info (enum target_signal oursig) printf_filtered ("%s\t", signal_stop[oursig] ? "Yes" : "No"); printf_filtered ("%s\t", signal_print[oursig] ? "Yes" : "No"); printf_filtered ("%s\t\t", signal_program[oursig] ? "Yes" : "No"); - printf_filtered ("%s\n", target_signal_to_string (oursig)); + printf_filtered ("%s\n", gdb_signal_to_string (oursig)); } /* Specify how various signals in the inferior should be handled. */ @@ -6282,7 +6282,7 @@ handle_command (char *args, int from_tty) char **argv; int digits, wordlen; int sigfirst, signum, siglast; - enum target_signal oursig; + enum gdb_signal oursig; int allsigs; int nsigs; unsigned char *sigs; @@ -6369,11 +6369,11 @@ handle_command (char *args, int from_tty) SIGHUP, SIGINT, SIGALRM, etc. will work right anyway. */ sigfirst = siglast = (int) - target_signal_from_command (atoi (*argv)); + gdb_signal_from_command (atoi (*argv)); if ((*argv)[digits] == '-') { siglast = (int) - target_signal_from_command (atoi ((*argv) + digits + 1)); + gdb_signal_from_command (atoi ((*argv) + digits + 1)); } if (sigfirst > siglast) { @@ -6385,7 +6385,7 @@ handle_command (char *args, int from_tty) } else { - oursig = target_signal_from_name (*argv); + oursig = gdb_signal_from_name (*argv); if (oursig != TARGET_SIGNAL_UNKNOWN) { sigfirst = siglast = (int) oursig; @@ -6402,7 +6402,7 @@ handle_command (char *args, int from_tty) for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++) { - switch ((enum target_signal) signum) + switch ((enum gdb_signal) signum) { case TARGET_SIGNAL_TRAP: case TARGET_SIGNAL_INT: @@ -6410,7 +6410,7 @@ handle_command (char *args, int from_tty) { 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))) + gdb_signal_to_name ((enum gdb_signal) signum))) { sigs[signum] = 1; } @@ -6480,9 +6480,9 @@ xdb_handle_command (char *args, int from_tty) if (argBuf) { int validFlag = 1; - enum target_signal oursig; + enum gdb_signal oursig; - oursig = target_signal_from_name (argv[0]); + oursig = gdb_signal_from_name (argv[0]); memset (argBuf, 0, bufLen); if (strcmp (argv[1], "Q") == 0) sprintf (argBuf, "%s %s", argv[0], "noprint"); @@ -6523,11 +6523,11 @@ xdb_handle_command (char *args, int from_tty) do_cleanups (old_chain); } -enum target_signal -target_signal_from_command (int num) +enum gdb_signal +gdb_signal_from_command (int num) { if (num >= 1 && num <= 15) - return (enum target_signal) num; + return (enum gdb_signal) num; error (_("Only signals 1-15 are valid as numeric signals.\n\ Use \"info signals\" for a list of symbolic signals.")); } @@ -6540,19 +6540,19 @@ Use \"info signals\" for a list of symbolic signals.")); static void signals_info (char *signum_exp, int from_tty) { - enum target_signal oursig; + enum gdb_signal oursig; sig_print_header (); if (signum_exp) { /* First see if this is a symbol name. */ - oursig = target_signal_from_name (signum_exp); + oursig = gdb_signal_from_name (signum_exp); if (oursig == TARGET_SIGNAL_UNKNOWN) { /* No, try numeric. */ oursig = - target_signal_from_command (parse_and_eval_long (signum_exp)); + gdb_signal_from_command (parse_and_eval_long (signum_exp)); } sig_print_info (oursig); return; @@ -6562,7 +6562,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 = (enum gdb_signal) ((int) oursig + 1)) { QUIT; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 86b3c7df51..320a759f76 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1093,7 +1093,7 @@ linux_nat_pass_signals (int numsigs, unsigned char *pass_signals) for (signo = 1; signo < NSIG; signo++) { - int target_signo = target_signal_from_host (signo); + int target_signo = gdb_signal_from_host (signo); if (target_signo < numsigs && pass_signals[target_signo]) sigaddset (&pass_mask, signo); } @@ -1670,16 +1670,16 @@ linux_nat_attach (struct target_ops *ops, char *args, int from_tty) } else if (WIFSIGNALED (status)) { - enum target_signal signo; + enum gdb_signal signo; target_terminal_ours (); target_mourn_inferior (); - signo = target_signal_from_host (WTERMSIG (status)); + signo = gdb_signal_from_host (WTERMSIG (status)); error (_("Unable to attach: program terminated with signal " "%s, %s."), - target_signal_to_name (signo), - target_signal_to_string (signo)); + gdb_signal_to_name (signo), + gdb_signal_to_string (signo)); } internal_error (__FILE__, __LINE__, @@ -1706,7 +1706,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; + enum gdb_signal 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), @@ -1732,7 +1732,7 @@ get_pending_status (struct lwp_info *lp, int *status) if (lp->waitstatus.kind != TARGET_WAITKIND_IGNORE) signo = TARGET_SIGNAL_0; /* a pending ptrace event, not a real signal. */ else if (lp->status) - signo = target_signal_from_host (WSTOPSIG (lp->status)); + signo = gdb_signal_from_host (WSTOPSIG (lp->status)); else if (non_stop && !is_executing (lp->ptid)) { struct thread_info *tp = find_thread_ptid (lp->ptid); @@ -1770,17 +1770,17 @@ get_pending_status (struct lwp_info *lp, int *status) "GPT: lwp %s had signal %s, " "but it is in no pass state\n", target_pid_to_str (lp->ptid), - target_signal_to_string (signo)); + gdb_signal_to_string (signo)); } else { - *status = W_STOPCODE (target_signal_to_host (signo)); + *status = W_STOPCODE (gdb_signal_to_host (signo)); if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "GPT: lwp %s has pending signal %s\n", target_pid_to_str (lp->ptid), - target_signal_to_string (signo)); + gdb_signal_to_string (signo)); } return 0; @@ -1974,7 +1974,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, enum gdb_signal signo) { sigset_t prev_mask; struct lwp_info *lp; @@ -1986,7 +1986,7 @@ linux_nat_resume (struct target_ops *ops, step ? "step" : "resume", target_pid_to_str (ptid), (signo != TARGET_SIGNAL_0 - ? strsignal (target_signal_to_host (signo)) : "0"), + ? strsignal (gdb_signal_to_host (signo)) : "0"), target_pid_to_str (inferior_ptid)); block_child_signals (&prev_mask); @@ -2032,7 +2032,7 @@ linux_nat_resume (struct target_ops *ops, /* FIXME: What should we do if we are supposed to continue this thread with a signal? */ gdb_assert (signo == TARGET_SIGNAL_0); - signo = target_signal_from_host (WSTOPSIG (lp->status)); + signo = gdb_signal_from_host (WSTOPSIG (lp->status)); lp->status = 0; } } @@ -2080,7 +2080,7 @@ linux_nat_resume (struct target_ops *ops, step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", target_pid_to_str (ptid), (signo != TARGET_SIGNAL_0 - ? strsignal (target_signal_to_host (signo)) : "0")); + ? strsignal (gdb_signal_to_host (signo)) : "0")); restore_child_signals_mask (&prev_mask); if (target_can_async_p ()) @@ -3864,7 +3864,7 @@ retry: if (WIFSTOPPED (status)) { - enum target_signal signo = target_signal_from_host (WSTOPSIG (status)); + enum gdb_signal signo = gdb_signal_from_host (WSTOPSIG (status)); /* When using hardware single-step, we need to report every signal. Otherwise, signals in pass_mask may be short-circuited. */ @@ -3888,7 +3888,7 @@ retry: "PTRACE_SINGLESTEP" : "PTRACE_CONT", target_pid_to_str (lp->ptid), (signo != TARGET_SIGNAL_0 - ? strsignal (target_signal_to_host (signo)) + ? strsignal (gdb_signal_to_host (signo)) : "0")); lp->stopped = 0; goto retry; @@ -4446,7 +4446,7 @@ static char * linux_nat_collect_thread_registers (const struct regcache *regcache, ptid_t ptid, bfd *obfd, char *note_data, int *note_size, - enum target_signal stop_signal) + enum gdb_signal stop_signal) { struct gdbarch *gdbarch = get_regcache_arch (regcache); const struct regset *regset; @@ -4466,7 +4466,7 @@ linux_nat_collect_thread_registers (const struct regcache *regcache, note_data = (char *) elfcore_write_prstatus (obfd, note_data, note_size, ptid_get_lwp (ptid), - target_signal_to_host (stop_signal), &gregs); + gdb_signal_to_host (stop_signal), &gregs); if (core_regset_p && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 6198d0085d..861dc22c08 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -592,7 +592,7 @@ find_signalled_thread (struct thread_info *info, void *data) return 0; } -static enum target_signal +static enum gdb_signal find_stop_signal (void) { struct thread_info *info = @@ -683,7 +683,7 @@ static char * linux_collect_thread_registers (const struct regcache *regcache, ptid_t ptid, bfd *obfd, char *note_data, int *note_size, - enum target_signal stop_signal) + enum gdb_signal stop_signal) { struct gdbarch *gdbarch = get_regcache_arch (regcache); struct core_regset_section *sect_list; @@ -714,7 +714,7 @@ linux_collect_thread_registers (const struct regcache *regcache, if (strcmp (sect_list->sect_name, ".reg") == 0) note_data = (char *) elfcore_write_prstatus (obfd, note_data, note_size, lwp, - target_signal_to_host (stop_signal), buf); + gdb_signal_to_host (stop_signal), buf); else note_data = (char *) elfcore_write_register_note (obfd, note_data, note_size, @@ -737,7 +737,7 @@ struct linux_corefile_thread_data char *note_data; int *note_size; int num_notes; - enum target_signal stop_signal; + enum gdb_signal stop_signal; linux_collect_thread_registers_ftype collect; }; diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h index d2f40773c5..b211b538cf 100644 --- a/gdb/linux-tdep.h +++ b/gdb/linux-tdep.h @@ -27,7 +27,7 @@ struct regcache; typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *, ptid_t, bfd *, char *, int *, - enum target_signal); + enum gdb_signal); char *linux_make_corefile_notes (struct gdbarch *, bfd *, int *, linux_collect_thread_registers_ftype); diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index f78f662d43..38fd512a20 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1101,9 +1101,9 @@ check_thread_signals (void) { if (sigismember (&mask, i)) { - if (signal_stop_update (target_signal_from_host (i), 0)) + if (signal_stop_update (gdb_signal_from_host (i), 0)) sigaddset (&thread_stop_set, i); - if (signal_print_update (target_signal_from_host (i), 0)) + if (signal_print_update (gdb_signal_from_host (i), 0)) sigaddset (&thread_print_set, i); thread_signals = 1; } @@ -1828,7 +1828,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, enum gdb_signal signo) { struct target_ops *beneath = find_target_beneath (ops); struct thread_db_info *info; diff --git a/gdb/monitor.c b/gdb/monitor.c index 5bbf70ac44..e5a2a7c6ec 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -934,7 +934,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, enum gdb_signal sig) { /* Some monitors require a different command when starting a program. */ monitor_debug ("MON resume\n"); diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 82d2b584e6..2332fd1540 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -767,7 +767,7 @@ procfs_wait (struct target_ops *ops, case _DEBUG_WHY_SIGNALLED: ourstatus->kind = TARGET_WAITKIND_STOPPED; ourstatus->value.sig = - target_signal_from_host (status.info.si_signo); + gdb_signal_from_host (status.info.si_signo); exit_signo = 0; break; case _DEBUG_WHY_FAULTED: @@ -780,7 +780,7 @@ procfs_wait (struct target_ops *ops, else { ourstatus->value.sig = - target_signal_from_host (status.info.si_signo); + gdb_signal_from_host (status.info.si_signo); exit_signo = ourstatus->value.sig; } break; @@ -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, enum gdb_signal signo) { int signal_to_pass; procfs_status status; @@ -982,12 +982,12 @@ procfs_resume (struct target_ops *ops, run.flags |= _DEBUG_RUN_ARM; - signal_to_pass = target_signal_to_host (signo); + signal_to_pass = gdb_signal_to_host (signo); if (signal_to_pass) { devctl (ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0); - signal_to_pass = target_signal_to_host (signo); + signal_to_pass = gdb_signal_to_host (signo); if (status.why & (_DEBUG_WHY_SIGNALLED | _DEBUG_WHY_FAULTED)) { if (signal_to_pass != status.info.si_signo) @@ -1340,7 +1340,7 @@ procfs_pass_signals (int numsigs, unsigned char *pass_signals) for (signo = 1; signo < NSIG; signo++) { - int target_signo = target_signal_from_host (signo); + int target_signo = gdb_signal_from_host (signo); if (target_signo < numsigs && pass_signals[target_signo]) sigdelset (&run.trace, signo); } diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c index e7a530e86d..5e0c9105cf 100644 --- a/gdb/nto-tdep.c +++ b/gdb/nto-tdep.c @@ -376,9 +376,9 @@ nto_initialize_signals (void) { /* We use SIG45 for pulses, or something, so nostop, noprint and pass them. */ - signal_stop_update (target_signal_from_name ("SIG45"), 0); - signal_print_update (target_signal_from_name ("SIG45"), 0); - signal_pass_update (target_signal_from_name ("SIG45"), 1); + signal_stop_update (gdb_signal_from_name ("SIG45"), 0); + signal_print_update (gdb_signal_from_name ("SIG45"), 0); + signal_pass_update (gdb_signal_from_name ("SIG45"), 1); /* By default we don't want to stop on these two, but we do want to pass. */ #if defined(SIGSELECT) diff --git a/gdb/procfs.c b/gdb/procfs.c index 0d47f80a06..7c5bfd31ec 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -112,7 +112,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, enum gdb_signal); static void procfs_stop (ptid_t); static void procfs_files_info (struct target_ops *); static void procfs_fetch_registers (struct target_ops *, @@ -2122,7 +2122,7 @@ proc_set_current_signal (procinfo *pi, int signo) get_last_target_status (&wait_ptid, &wait_status); if (ptid_equal (wait_ptid, inferior_ptid) && wait_status.kind == TARGET_WAITKIND_STOPPED - && wait_status.value.sig == target_signal_from_host (signo) + && wait_status.value.sig == gdb_signal_from_host (signo) && proc_get_status (pi) #ifdef NEW_PROC_API && pi->prstatus.pr_lwp.pr_info.si_signo == signo @@ -4182,7 +4182,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, enum gdb_signal signo) { procinfo *pi, *thread; int native_signo; @@ -4214,7 +4214,7 @@ procfs_resume (struct target_ops *ops, (signo == TARGET_SIGNAL_STOP && pi->ignore_next_sigstop)) native_signo = 0; else - native_signo = target_signal_to_host (signo); + native_signo = gdb_signal_to_host (signo); pi->ignore_next_sigstop = 0; @@ -4273,7 +4273,7 @@ procfs_pass_signals (int numsigs, unsigned char *pass_signals) for (signo = 0; signo < NSIG; signo++) { - int target_signo = target_signal_from_host (signo); + int target_signo = gdb_signal_from_host (signo); if (target_signo < numsigs && pass_signals[target_signo]) gdb_prdelset (&signals, signo); } @@ -5411,7 +5411,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) + enum gdb_signal stop_signal) { struct regcache *regcache = get_thread_regcache (ptid); gdb_gregset_t gregs; @@ -5462,7 +5462,7 @@ struct procfs_corefile_thread_data { bfd *obfd; char *note_data; int *note_size; - enum target_signal stop_signal; + enum gdb_signal stop_signal; }; static int @@ -5492,7 +5492,7 @@ find_signalled_thread (struct thread_info *info, void *data) return 0; } -static enum target_signal +static enum gdb_signal find_stop_signal (void) { struct thread_info *info = @@ -5518,7 +5518,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; + enum gdb_signal stop_signal; if (get_exec_file (0)) { diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 86b478de81..0ea4f55d81 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -81,7 +81,7 @@ static void python_on_normal_stop (struct bpstats *bs, int print_frame) { struct cleanup *cleanup; - enum target_signal stop_signal; + enum gdb_signal stop_signal; if (!find_thread_ptid (inferior_ptid)) return; diff --git a/gdb/python/py-signalevent.c b/gdb/python/py-signalevent.c index 323d6f6706..304b847f74 100644 --- a/gdb/python/py-signalevent.c +++ b/gdb/python/py-signalevent.c @@ -22,7 +22,7 @@ static PyTypeObject signal_event_object_type; PyObject * -create_signal_event_object (enum target_signal stop_signal) +create_signal_event_object (enum gdb_signal stop_signal) { const char *signal_name; PyObject *signal_event_obj = @@ -31,7 +31,7 @@ create_signal_event_object (enum target_signal stop_signal) if (!signal_event_obj) goto fail; - signal_name = target_signal_to_name (stop_signal); + signal_name = gdb_signal_to_name (stop_signal); if (evpy_add_attribute (signal_event_obj, "stop_signal", diff --git a/gdb/python/py-stopevent.c b/gdb/python/py-stopevent.c index 1df4ae9e1d..7660dd2412 100644 --- a/gdb/python/py-stopevent.c +++ b/gdb/python/py-stopevent.c @@ -42,7 +42,7 @@ create_stop_event_object (PyTypeObject *py_type) returns -1. */ int -emit_stop_event (struct bpstats *bs, enum target_signal stop_signal) +emit_stop_event (struct bpstats *bs, enum gdb_signal stop_signal) { PyObject *stop_event_obj = NULL; /* Appease GCC warning. */ PyObject *list = NULL; diff --git a/gdb/python/py-stopevent.h b/gdb/python/py-stopevent.h index df642860c7..69e688ac45 100644 --- a/gdb/python/py-stopevent.h +++ b/gdb/python/py-stopevent.h @@ -26,11 +26,11 @@ extern PyObject *create_stop_event_object (PyTypeObject *py_type); extern void stop_evpy_dealloc (PyObject *self); extern int emit_stop_event (struct bpstats *bs, - enum target_signal stop_signal); + enum gdb_signal stop_signal); extern PyObject *create_breakpoint_event_object (PyObject *breakpoint_list, PyObject *first_bp); -extern PyObject *create_signal_event_object (enum target_signal stop_signal); +extern PyObject *create_signal_event_object (enum gdb_signal stop_signal); #endif /* GDB_PY_STOPEVENT_H */ diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 9b9e7fe4bc..385438175a 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -72,7 +72,7 @@ static void ravenscar_store_registers (struct target_ops *ops, static void ravenscar_prepare_to_store (struct regcache *regcache); static void ravenscar_initialize (char *name, int from_tty); static void ravenscar_resume (struct target_ops *ops, ptid_t ptid, int step, - enum target_signal siggnal); + enum gdb_signal siggnal); static void ravenscar_mourn_inferior (struct target_ops *ops); static void ravenscar_update_inferior_ptid (void); static int has_ravenscar_runtime (void); @@ -187,7 +187,7 @@ ravenscar_close (int quitting) static void ravenscar_resume (struct target_ops *ops, ptid_t ptid, int step, - enum target_signal siggnal) + enum gdb_signal siggnal) { struct target_ops *beneath = find_target_beneath (ops); diff --git a/gdb/record.c b/gdb/record.c index 7db15277ed..60ea12029a 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -100,7 +100,7 @@ struct record_reg_entry struct record_end_entry { - enum target_signal sigval; + enum gdb_signal sigval; ULONGEST insn_num; }; @@ -209,7 +209,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); + enum gdb_signal); static struct target_ops *record_beneath_to_wait_ops; static ptid_t (*record_beneath_to_wait) (struct target_ops *, ptid_t, struct target_waitstatus *, @@ -581,7 +581,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, enum gdb_signal signal) { int ret; struct gdbarch *gdbarch = get_regcache_arch (regcache); @@ -652,7 +652,7 @@ record_message (struct regcache *regcache, enum target_signal signal) struct record_message_args { struct regcache *regcache; - enum target_signal signal; + enum gdb_signal signal; }; static int @@ -665,7 +665,7 @@ record_message_wrapper (void *args) static int record_message_wrapper_safe (struct regcache *regcache, - enum target_signal signal) + enum gdb_signal signal) { struct record_message_args args; @@ -786,7 +786,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); + enum gdb_signal); static struct target_ops *tmp_to_wait_ops; static ptid_t (*tmp_to_wait) (struct target_ops *, ptid_t, struct target_waitstatus *, @@ -1060,7 +1060,7 @@ static enum exec_direction_kind record_execution_dir = EXEC_FORWARD; static void record_resume (struct target_ops *ops, ptid_t ptid, int step, - enum target_signal signal) + enum gdb_signal signal) { record_resume_step = step; record_resumed = 1; @@ -1981,7 +1981,7 @@ init_record_ops (void) static void record_core_resume (struct target_ops *ops, ptid_t ptid, int step, - enum target_signal signal) + enum gdb_signal signal) { record_resume_step = step; record_resumed = 1; diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index becd5d57ca..f1592d72d0 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -450,7 +450,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, enum gdb_signal sig) { unsigned long pc_addr, bp_addr, ab_addr; int ib_breakpoints; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 1313a7fb8a..b637bc096a 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1756,7 +1756,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, enum gdb_signal siggnal) { int err; @@ -1770,7 +1770,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 enum gdb_signal mips_signal_from_protocol (int sig) { /* We allow a few more signals than the IDT board actually returns, on @@ -1780,11 +1780,11 @@ mips_signal_from_protocol (int sig) || sig > 31) return TARGET_SIGNAL_UNKNOWN; - /* Don't want to use target_signal_from_host because we are converting + /* Don't want to use gdb_signal_from_host because we are converting 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 (enum gdb_signal) sig; } /* Set the register designated by REGNO to the value designated by VALUE. */ diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 75a7941cb3..2c228321dc 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -118,7 +118,7 @@ struct sim_inferior_data { ptid_t remote_sim_ptid; /* Signal with which to resume. */ - enum target_signal resume_siggnal; + enum gdb_signal resume_siggnal; /* Flag which indicates whether resume should step or not. */ int resume_step; @@ -838,7 +838,7 @@ gdbsim_detach (struct target_ops *ops, char *args, int from_tty) struct resume_data { - enum target_signal siggnal; + enum gdb_signal siggnal; int step; }; @@ -867,7 +867,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, enum gdb_signal siggnal) { struct resume_data rd; struct sim_inferior_data *sim_data diff --git a/gdb/remote.c b/gdb/remote.c index 3717a2603a..8aa531234f 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4612,7 +4612,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, enum gdb_signal siggnal) { struct remote_state *rs = get_remote_state (); @@ -4655,7 +4655,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, enum gdb_signal siggnal) { struct remote_state *rs = get_remote_state (); char *p; @@ -4723,13 +4723,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 enum gdb_signal 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, enum gdb_signal siggnal) { struct remote_state *rs = get_remote_state (); char *buf; @@ -5384,7 +5384,7 @@ Packet: '%s'\n"), else { event->ws.kind = TARGET_WAITKIND_STOPPED; - event->ws.value.sig = (enum target_signal) + event->ws.value.sig = (enum gdb_signal) (((fromhex (buf[1])) << 4) + (fromhex (buf[2]))); } break; @@ -5410,7 +5410,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 = (enum gdb_signal) value; } /* If no process is specified, assume inferior_ptid. */ @@ -5736,7 +5736,7 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options) target_terminal_ours_for_output (); printf_filtered ("Can't send signals to this remote system. %s not sent.\n", - target_signal_to_name (last_sent_signal)); + gdb_signal_to_name (last_sent_signal)); last_sent_signal = TARGET_SIGNAL_0; target_terminal_inferior (); diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 01bc2e0545..3577b5affd 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -345,7 +345,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, enum gdb_signal signo) { struct cleanup *old_chain; struct target_ops *beneath = find_target_beneath (ops); diff --git a/gdb/target.c b/gdb/target.c index 6dba9361db..151209e246 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2670,7 +2670,7 @@ target_thread_name (struct thread_info *info) } void -target_resume (ptid_t ptid, int step, enum target_signal signal) +target_resume (ptid_t ptid, int step, enum gdb_signal signal) { struct target_ops *t; @@ -2685,7 +2685,7 @@ target_resume (ptid_t ptid, int step, enum target_signal signal) fprintf_unfiltered (gdb_stdlog, "target_resume (%d, %s, %s)\n", PIDGET (ptid), step ? "step" : "continue", - target_signal_to_name (signal)); + gdb_signal_to_name (signal)); registers_changed_ptid (ptid); set_executing (ptid, 1); @@ -2717,7 +2717,7 @@ target_pass_signals (int numsigs, unsigned char *pass_signals) for (i = 0; i < numsigs; i++) if (pass_signals[i]) fprintf_unfiltered (gdb_stdlog, " %s", - target_signal_to_name (i)); + gdb_signal_to_name (i)); fprintf_unfiltered (gdb_stdlog, " })\n"); } @@ -2747,7 +2747,7 @@ target_program_signals (int numsigs, unsigned char *program_signals) for (i = 0; i < numsigs; i++) if (program_signals[i]) fprintf_unfiltered (gdb_stdlog, " %s", - target_signal_to_name (i)); + gdb_signal_to_name (i)); fprintf_unfiltered (gdb_stdlog, " })\n"); } @@ -3852,10 +3852,10 @@ target_waitstatus_to_string (const struct target_waitstatus *ws) kind_str, ws->value.integer); case TARGET_WAITKIND_STOPPED: return xstrprintf ("%sstopped, signal = %s", - kind_str, target_signal_to_name (ws->value.sig)); + kind_str, gdb_signal_to_name (ws->value.sig)); case TARGET_WAITKIND_SIGNALLED: return xstrprintf ("%ssignalled, signal = %s", - kind_str, target_signal_to_name (ws->value.sig)); + kind_str, gdb_signal_to_name (ws->value.sig)); case TARGET_WAITKIND_LOADED: return xstrprintf ("%sloaded", kind_str); case TARGET_WAITKIND_FORKED: diff --git a/gdb/target.h b/gdb/target.h index 84b462a3d3..631c93b0cf 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -164,7 +164,7 @@ struct target_waitstatus union { int integer; - enum target_signal sig; + enum gdb_signal sig; ptid_t related_pid; char *execd_pathname; int syscall_number; @@ -419,7 +419,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, enum gdb_signal); ptid_t (*to_wait) (struct target_ops *, ptid_t, struct target_waitstatus *, int); void (*to_fetch_registers) (struct target_ops *, struct regcache *, int); @@ -925,7 +925,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, enum gdb_signal 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; @@ -1254,7 +1254,7 @@ void target_mourn_inferior (void); /* Set list of signals to be handled in the target. PASS_SIGNALS is an array of size NSIG, indexed by target signal number - (enum target_signal). For every signal whose entry in this array is + (enum gdb_signal). For every signal whose entry in this array is non-zero, the target is allowed -but not required- to skip reporting arrival of the signal to the GDB core by returning from target_wait, and to pass the signal directly to the inferior instead. @@ -1269,7 +1269,7 @@ extern void target_pass_signals (int nsig, unsigned char *pass_signals); directly maps to the "handle SIGNAL pass/nopass" setting. PROGRAM_SIGNALS is an array of size NSIG, indexed by target signal - number (enum target_signal). For every signal whose entry in this + number (enum gdb_signal). For every signal whose entry in this array is non-zero, the target is allowed to pass the signal to the inferior. Signals not present in the array shall be silently discarded. This does not influence whether to pass signals to the diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 000c86f5cc..088cd8a8ea 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -176,7 +176,7 @@ static CORE_ADDR cygwin_get_dr (int i); static unsigned long cygwin_get_dr6 (void); static unsigned long cygwin_get_dr7 (void); -static enum target_signal last_sig = TARGET_SIGNAL_0; +static enum gdb_signal last_sig = TARGET_SIGNAL_0; /* Set if a signal was received from the debugged process. */ /* Thread information structure used to track information that is @@ -253,7 +253,7 @@ static segment_register_p_ftype *segment_register_p; struct xlate_exception { int them; - enum target_signal us; + enum gdb_signal us; }; static const struct xlate_exception @@ -966,7 +966,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus) to treat this like a real signal. */ char *p; int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0); - int gotasig = target_signal_from_host (sig); + int gotasig = gdb_signal_from_host (sig); ourstatus->value.sig = gotasig; if (gotasig) { @@ -1311,7 +1311,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, enum gdb_signal sig) { thread_info *th; DWORD continue_status = DBG_CONTINUE; diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index cb8df1cbac..742db1ba47 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-05-24 Pedro Alves + + PR gdb/7205 + + Replace target_signal with gdb_signal throughout. + 2012-04-12 Mike Frysinger * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define. diff --git a/include/gdb/callback.h b/include/gdb/callback.h index 5c0d2db747..d8d14727d3 100644 --- a/include/gdb/callback.h +++ b/include/gdb/callback.h @@ -314,7 +314,7 @@ int cb_target_to_host_open (host_callback *, int); int cb_target_to_host_signal (host_callback *, int); /* Translate host signal number to target. */ -int cb_host_to_target_signal (host_callback *, int); +int cb_host_to_gdb_signal (host_callback *, int); /* Translate host stat struct to target. If stat struct ptr is NULL, just compute target stat struct size. diff --git a/include/gdb/signals.h b/include/gdb/signals.h index 67902c6170..a59d3b5c60 100644 --- a/include/gdb/signals.h +++ b/include/gdb/signals.h @@ -45,9 +45,9 @@ etc. are doing to address these issues. */ /* For an explanation of what each signal means, see - target_signal_to_string. */ + gdb_signal_to_string. */ -enum target_signal +enum gdb_signal { #define SET(symbol, constant, name, string) \ symbol = constant, diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 71af5ac42e..588ff680c5 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +2012-05-24 Pedro Alves + + PR gdb/7205 + + Replace target_signal with gdb_signal throughout. + 2012-05-18 Nick Clifton PR 14072 diff --git a/sim/common/sim-signal.c b/sim/common/sim-signal.c index df0a371c2e..9e478cbdf9 100644 --- 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 +enum gdb_signal sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL sig) { switch (sig) diff --git a/sim/common/sim-signal.h b/sim/common/sim-signal.h index b4ff4099a2..0d23dd40ae 100644 --- 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); +enum gdb_signal sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL); #endif /* SIM_SIGNAL_H */ -- 2.34.1