+2012-05-24 Pedro Alves <palves@redhat.com>
+
+ PR gdb/7205
+
+ Replace target_signal with gdb_signal throughout.
+
2012-05-24 Pedro Alves <palves@redhat.com>
PR tui/14159
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];
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);
}
}
static int
amd64_linux_record_signal (struct gdbarch *gdbarch,
struct regcache *regcache,
- enum target_signal signal)
+ enum gdb_signal signal)
{
ULONGEST rsp;
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);
}
/* */
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
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);
#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 */
#endif
/* This table must match in order and size the signals in enum
- target_signal. */
+ gdb_signal. */
static const struct {
const char *name;
/* 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;
/* 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)
}
/* 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
/* 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;
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. */
{
/* 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
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;
}
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
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. */
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);
}
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;
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)
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);
}
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. */
#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. */
return 0;
}
-static enum target_signal
+static enum gdb_signal
find_stop_signal (void)
{
struct thread_info *info =
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;
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:
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;
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 */
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;
/* 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. */
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));
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));
}
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);
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
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.
# 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.
#
+2012-05-24 Pedro Alves <palves@redhat.com>
+
+ PR gdb/7205
+
+ Replace target_signal with gdb_signal throughout.
+
2012-05-22 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.c (linux_store_registers): Avoid the copying sequence
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);
return 0;
}
- signo = target_signal_from_host (WSTOPSIG (status));
+ signo = gdb_signal_from_host (WSTOPSIG (status));
if (program_signals_p && !program_signals[signo])
{
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
"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
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);
}
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);
}
}
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,
|| 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))))
{
{
/* 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));
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);
}
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);
}
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 ????");
}
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:
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;
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
{
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);
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);
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)
{
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);
}
}
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);
}
"\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;
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);
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;
};
union
{
int integer;
- enum target_signal sig;
+ enum gdb_signal sig;
ptid_t related_pid;
char *execd_pathname;
}
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;
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;
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
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...) \
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
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
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;
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))
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);
static struct
{
int go32_sig;
- enum target_signal gdb_sig;
+ enum gdb_signal gdb_sig;
}
sig_map[] =
{
};
static struct {
- enum target_signal gdb_sig;
+ enum gdb_signal gdb_sig;
int djgpp_excepno;
} excepn_map[] = {
{TARGET_SIGNAL_0, -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;
}
if (resume_signal == -1)
printf_unfiltered ("Cannot deliver signal %s on this platform.\n",
- target_signal_to_name (siggnal));
+ gdb_signal_to_name (siggnal));
}
}
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);
}
}
- 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"));
}
static int
i386_linux_record_signal (struct gdbarch *gdbarch,
struct regcache *regcache,
- enum target_signal signal)
+ enum gdb_signal signal)
{
ULONGEST esp;
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;
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"));
}
\f
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));
}
}
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;
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"));
}
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'. */
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:
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. */
/* 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)
{
if (num == 0)
oursig = TARGET_SIGNAL_0;
else
- oursig = target_signal_from_command (num);
+ oursig = gdb_signal_from_command (num);
}
if (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 ();
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)
/* For bpstat. */
#include "breakpoint.h"
-/* For enum target_signal. */
+/* For enum gdb_signal. */
#include "target.h"
/* For struct frame_id. */
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;
/* 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);
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) */
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);
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);
}
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
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);
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;
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,"
/* 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;
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");
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;
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");
}
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)
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. */
char **argv;
int digits, wordlen;
int sigfirst, signum, siglast;
- enum target_signal oursig;
+ enum gdb_signal oursig;
int allsigs;
int nsigs;
unsigned char *sigs;
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)
{
}
else
{
- oursig = target_signal_from_name (*argv);
+ oursig = gdb_signal_from_name (*argv);
if (oursig != TARGET_SIGNAL_UNKNOWN)
{
sigfirst = siglast = (int) oursig;
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:
{
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;
}
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");
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."));
}
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;
/* 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;
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);
}
}
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__,
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),
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);
"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;
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;
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);
/* 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;
}
}
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 ())
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. */
"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;
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;
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",
return 0;
}
-static enum target_signal
+static enum gdb_signal
find_stop_signal (void)
{
struct thread_info *info =
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;
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,
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;
};
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);
{
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;
}
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;
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");
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:
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;
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;
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)
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);
}
{
/* 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)
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 *,
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
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;
(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;
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);
}
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;
bfd *obfd;
char *note_data;
int *note_size;
- enum target_signal stop_signal;
+ enum gdb_signal stop_signal;
};
static int
return 0;
}
-static enum target_signal
+static enum gdb_signal
find_stop_signal (void)
{
struct thread_info *info =
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))
{
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;
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 =
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",
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;
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 */
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);
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);
struct record_end_entry
{
- enum target_signal sigval;
+ enum gdb_signal sigval;
ULONGEST insn_num;
};
/* 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 *,
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);
struct record_message_args {
struct regcache *regcache;
- enum target_signal signal;
+ enum gdb_signal signal;
};
static int
static int
record_message_wrapper_safe (struct regcache *regcache,
- enum target_signal signal)
+ enum gdb_signal signal)
{
struct record_message_args args;
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 *,
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;
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;
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;
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;
/* 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
|| 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. */
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;
struct resume_data
{
- enum target_signal siggnal;
+ enum gdb_signal siggnal;
int step;
};
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
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 ();
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;
/* 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;
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;
{
/* 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. */
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 ();
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);
}
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;
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);
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");
}
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");
}
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:
union
{
int integer;
- enum target_signal sig;
+ enum gdb_signal sig;
ptid_t related_pid;
char *execd_pathname;
int syscall_number;
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);
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;
/* 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.
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
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
struct xlate_exception
{
int them;
- enum target_signal us;
+ enum gdb_signal us;
};
static const struct xlate_exception
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)
{
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;
+2012-05-24 Pedro Alves <palves@redhat.com>
+
+ PR gdb/7205
+
+ Replace target_signal with gdb_signal throughout.
+
2012-04-12 Mike Frysinger <vapier@gentoo.org>
* callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define.
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.
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,
+2012-05-24 Pedro Alves <palves@redhat.com>
+
+ PR gdb/7205
+
+ Replace target_signal with gdb_signal throughout.
+
2012-05-18 Nick Clifton <nickc@redhat.com>
PR 14072
#endif
}
-enum target_signal
+enum gdb_signal
sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL sig)
{
switch (sig)
} 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 */