/* Interface GDB to the GNU Hurd.
- Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2006, 2007,
- 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995-2001, 2006-2012 Free Software Foundation,
+ Inc.
This file is part of GDB.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "defs.h"
+
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <portinfo.h>
-#include "defs.h"
#include "inferior.h"
#include "symtab.h"
#include "value.h"
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...) \
if (inf->nomsg)
inf_continue (inf);
else
- inf_signal (inf, TARGET_SIGNAL_0);
+ inf_signal (inf, GDB_SIGNAL_0);
}
proc_restore_exc_port (task);
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
inf->pending_execs);
}
else if (kind == TARGET_WAITKIND_STOPPED
- && w->status.value.sig == TARGET_SIGNAL_TRAP)
+ && w->status.value.sig == GDB_SIGNAL_TRAP)
/* Ah hah! A SIGTRAP from the inferior while starting up probably
means we've succesfully completed an exec! */
{
if (exception == EXC_BREAKPOINT)
/* GDB likes to get SIGTRAP for breakpoints. */
{
- inf->wait.status.value.sig = TARGET_SIGNAL_TRAP;
+ inf->wait.status.value.sig = GDB_SIGNAL_TRAP;
mach_port_deallocate (mach_task_self (), reply_port);
}
else
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
warning (_("Pid %d died with unknown exit status, using SIGKILL."),
inf->pid);
inf->wait.status.kind = TARGET_WAITKIND_SIGNALLED;
- inf->wait.status.value.sig = TARGET_SIGNAL_KILL;
+ inf->wait.status.value.sig = GDB_SIGNAL_KILL;
}
/* Notify server routines. The only real one is dead name notification. */
server should like). */
{
inf->wait.status.kind = TARGET_WAITKIND_STOPPED;
- inf->wait.status.value.sig = TARGET_SIGNAL_0;
+ inf->wait.status.value.sig = GDB_SIGNAL_0;
}
else if (err)
warning (_("Signal delivery failed: %s"), safe_strerror (err));
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;
inf_validate_procinfo (inf);
- if (sig != TARGET_SIGNAL_0 || inf->stopped)
+ if (sig != GDB_SIGNAL_0 || inf->stopped)
{
- if (sig == TARGET_SIGNAL_0 && inf->nomsg)
+ if (sig == GDB_SIGNAL_0 && inf->nomsg)
inf_continue (inf);
else
inf_signal (inf, sig);
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))
{
inf_debug (gnu_current_inf, "%s %s[%d] %s %s",
write ? "writing" : "reading",
- paddress (target_gdbarch, memaddr), len,
+ paddress (target_gdbarch (), memaddr), len,
write ? "<--" : "-->", host_address_to_string (myaddr));
if (write)
return gnu_write_inferior (task, memaddr, myaddr, len);
last_protection & VM_PROT_READ,
last_protection & VM_PROT_WRITE,
last_protection & VM_PROT_EXECUTE,
+ 1, /* MODIFIED is unknown, pass it as true. */
data);
last_region_address = region_address;
last_region_end = region_address += region_length;
last_protection & VM_PROT_READ,
last_protection & VM_PROT_WRITE,
last_protection & VM_PROT_EXECUTE,
+ 1, /* MODIFIED is unknown, pass it as true. */
data);
return 0;
\f
/* User task commands. */
-struct cmd_list_element *set_task_cmd_list = 0;
-struct cmd_list_element *show_task_cmd_list = 0;
+static struct cmd_list_element *set_task_cmd_list = 0;
+static struct cmd_list_element *show_task_cmd_list = 0;
/* User thread commands. */
/* Commands with a prefix of `set/show thread'. */