projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2003-02-12 Andrew Cagney <ac131313@redhat.com>
[deliverable/binutils-gdb.git]
/
gdb
/
m3-nat.c
diff --git
a/gdb/m3-nat.c
b/gdb/m3-nat.c
index cb3cccf301fe81c2fc3562e98b139a423e301fc9..28e62a87f7638ac790a26a4454454d27b5871dcd 100644
(file)
--- a/
gdb/m3-nat.c
+++ b/
gdb/m3-nat.c
@@
-1,8
+1,8
@@
/* Interface GDB to Mach 3.0 operating systems.
(Most) Mach 3.0 related routines live in this file.
/* Interface GDB to Mach 3.0 operating systems.
(Most) Mach 3.0 related routines live in this file.
- Copyright
(C) 1992, 1996, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright
1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+
2002
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-57,6
+57,7
@@
#include "gdb_wait.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "gdb_wait.h"
#include "gdbcmd.h"
#include "gdbcore.h"
+#include "regcache.h"
#if 0
#include <servers/machid_lib.h>
#if 0
#include <servers/machid_lib.h>
@@
-1100,7
+1101,7
@@
select_thread (mach_port_t task, int thread_id, int flag)
stop_pc = read_pc ();
flush_cached_frames ();
stop_pc = read_pc ();
flush_cached_frames ();
- select_frame (get_current_frame ()
, 0
);
+ select_frame (get_current_frame ());
}
return KERN_SUCCESS;
}
return KERN_SUCCESS;
@@
-1231,10
+1232,10
@@
int mach_really_waiting;
There is no other way to exit this loop.
There is no other way to exit this loop.
- Returns the inferior_pid for rest of gdb.
+ Returns the inferior_p
t
id for rest of gdb.
Side effects: Set *OURSTATUS. */
Side effects: Set *OURSTATUS. */
-
in
t
-mach_really_wait (
int p
id, struct target_waitstatus *ourstatus)
+
ptid_
t
+mach_really_wait (
ptid_t pt
id, struct target_waitstatus *ourstatus)
{
kern_return_t ret;
int w;
{
kern_return_t ret;
int w;
@@
-1310,7
+1311,7
@@
mach_really_wait (int pid, struct target_waitstatus *ourstatus)
}
}
store_waitstatus (ourstatus, w);
}
}
store_waitstatus (ourstatus, w);
- return inferior_pid;
+ return inferior_p
t
id;
}
}
}
}
@@
-1345,7
+1346,7
@@
mach_really_wait (int pid, struct target_waitstatus *ourstatus)
mach3_exception_actions (&w, FALSE, "Task");
store_waitstatus (ourstatus, w);
mach3_exception_actions (&w, FALSE, "Task");
store_waitstatus (ourstatus, w);
- return inferior_pid;
+ return inferior_p
t
id;
}
}
}
}
}
}
@@
-1572,6
+1573,11
@@
mach_thread_output_id (int mid)
* if SELECT_IT is nonzero, reselect the thread that was active when
* we stopped at a breakpoint.
*
* if SELECT_IT is nonzero, reselect the thread that was active when
* we stopped at a breakpoint.
*
+ * Note that this implementation is potentially redundant now that
+ * default_prepare_to_proceed() has been added.
+ *
+ * FIXME This may not support switching threads after Ctrl-C
+ * correctly. The default implementation does support this.
*/
mach3_prepare_to_proceed (int select_it)
*/
mach3_prepare_to_proceed (int select_it)
@@
-1831,13
+1837,8
@@
mach3_read_inferior (CORE_ADDR addr, char *myaddr, int length)
return length;
}
return length;
}
-#ifdef __STDC__
#define CHK_GOTO_OUT(str,ret) \
do if (ret != KERN_SUCCESS) { errstr = #str; goto out; } while(0)
#define CHK_GOTO_OUT(str,ret) \
do if (ret != KERN_SUCCESS) { errstr = #str; goto out; } while(0)
-#else
-#define CHK_GOTO_OUT(str,ret) \
- do if (ret != KERN_SUCCESS) { errstr = str; goto out; } while(0)
-#endif
struct vm_region_list
{
struct vm_region_list
{
@@
-2938,7
+2939,7
@@
suspend_all_threads (int from_tty)
{
warning ("Could not suspend inferior threads.");
m3_kill_inferior ();
{
warning ("Could not suspend inferior threads.");
m3_kill_inferior ();
-
return_to_top_level
(RETURN_ERROR);
+
throw_exception
(RETURN_ERROR);
}
for (index = 0; index < thread_count; index++)
}
for (index = 0; index < thread_count; index++)
@@
-3107,7
+3108,7
@@
thread_resume_command (char *args, int from_tty)
{
if (current_thread)
current_thread = saved_thread;
{
if (current_thread)
current_thread = saved_thread;
-
return_to_top_level
(RETURN_ERROR);
+
throw_exception
(RETURN_ERROR);
}
ret = thread_info (current_thread,
}
ret = thread_info (current_thread,
@@
-3817,14
+3818,14
@@
kill_inferior_fast (void)
{
WAITTYPE w;
{
WAITTYPE w;
- if (
inferior_pid == 0 || inferior_pid
== 1)
+ if (
PIDGET (inferior_ptid) == 0 || PIDGET (inferior_ptid)
== 1)
return;
/* kill() it, since the Unix server does not otherwise notice when
* killed with task_terminate().
*/
return;
/* kill() it, since the Unix server does not otherwise notice when
* killed with task_terminate().
*/
- if (
inferior_pid
> 0)
- kill (
inferior_pid
, SIGKILL);
+ if (
PIDGET (inferior_ptid)
> 0)
+ kill (
PIDGET (inferior_ptid)
, SIGKILL);
/* It's propably terminate already */
(void) task_terminate (inferior_task);
/* It's propably terminate already */
(void) task_terminate (inferior_task);
@@
-3886,7
+3887,7
@@
ptrace (int a, int b, int c, int d)
If SIGNAL is nonzero, give it that signal. */
void
If SIGNAL is nonzero, give it that signal. */
void
-m3_resume (
int p
id, int step, enum target_signal signal)
+m3_resume (
ptid_t pt
id, int step, enum target_signal signal)
{
kern_return_t ret;
{
kern_return_t ret;
@@
-3915,8
+3916,8
@@
m3_resume (int pid, int step, enum target_signal signal)
vm_read_cache_valid = FALSE;
vm_read_cache_valid = FALSE;
- if (signal &&
inferior_pid > 0)
/* Do not signal, if attached by MID */
- kill (
inferior_pid
, target_signal_to_host (signal));
+ if (signal &&
PIDGET (inferior_ptid) > 0)
/* Do not signal, if attached by MID */
+ kill (
PIDGET (inferior_ptid)
, target_signal_to_host (signal));
if (step)
{
if (step)
{
@@
-4016,10
+4017,10
@@
m3_do_attach (int pid)
{
mid_attach (-(pid));
{
mid_attach (-(pid));
- /* inferior_pid will be NEGATIVE! */
- inferior_p
id = pid
;
+ /* inferior_p
t
id will be NEGATIVE! */
+ inferior_p
tid = pid_to_ptid (pid)
;
- return
inferior_pid
;
+ return
PIDGET (inferior_ptid)
;
}
inferior_task = task_by_pid (pid);
}
inferior_task = task_by_pid (pid);
@@
-4028,9
+4029,9
@@
m3_do_attach (int pid)
task_attach (inferior_task);
task_attach (inferior_task);
- inferior_p
id = pid
;
+ inferior_p
tid = pid_to_ptid (pid)
;
- return
inferior_pid
;
+ return
PIDGET (inferior_ptid)
;
}
/* Attach to process PID, then initialize for debugging it
}
/* Attach to process PID, then initialize for debugging it
@@
-4055,15
+4056,17
@@
m3_attach (char *args, int from_tty)
exec_file = (char *) get_exec_file (0);
if (exec_file)
exec_file = (char *) get_exec_file (0);
if (exec_file)
- printf_unfiltered ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid));
+ printf_unfiltered ("Attaching to program `%s', %s\n", exec_file,
+ target_pid_to_str (pid_to_ptid (pid)));
else
else
- printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid));
+ printf_unfiltered ("Attaching to %s\n",
+ target_pid_to_str (pid_to_ptid (pid)));
gdb_flush (gdb_stdout);
}
gdb_flush (gdb_stdout);
}
- m3_do_attach (pid);
- inferior_p
id = pid
;
+ m3_do_attach (pid
_to_ptid (pid)
);
+ inferior_p
tid = pid_to_ptid (pid)
;
push_target (&m3_ops);
}
\f
push_target (&m3_ops);
}
\f
@@
-4151,8
+4154,8
@@
m3_do_detach (int signal)
if (remove_breakpoints ())
warning ("Could not remove breakpoints when detaching");
if (remove_breakpoints ())
warning ("Could not remove breakpoints when detaching");
- if (signal &&
inferior_pid
> 0)
- kill (
inferior_pid
, signal);
+ if (signal &&
PIDGET (inferior_ptid)
> 0)
+ kill (
PIDGET (inferior_ptid)
, signal);
/* the task might be dead by now */
(void) task_resume (inferior_task);
/* the task might be dead by now */
(void) task_resume (inferior_task);
@@
-4181,14
+4184,14
@@
m3_detach (char *args, int from_tty)
if (exec_file == 0)
exec_file = "";
printf_unfiltered ("Detaching from program: %s %s\n",
if (exec_file == 0)
exec_file = "";
printf_unfiltered ("Detaching from program: %s %s\n",
- exec_file, target_pid_to_str (inferior_pid));
+ exec_file, target_pid_to_str (inferior_p
t
id));
gdb_flush (gdb_stdout);
}
if (args)
siggnal = atoi (args);
m3_do_detach (siggnal);
gdb_flush (gdb_stdout);
}
if (args)
siggnal = atoi (args);
m3_do_detach (siggnal);
- inferior_p
id = 0
;
+ inferior_p
tid = null_ptid
;
unpush_target (&m3_ops); /* Pop out of handling an inferior */
}
#endif /* ATTACH_DETACH */
unpush_target (&m3_ops); /* Pop out of handling an inferior */
}
#endif /* ATTACH_DETACH */
@@
-4214,7
+4217,7
@@
m3_files_info (struct target_ops *ignore)
{
/* FIXME: should print MID and all that crap. */
printf_unfiltered ("\tUsing the running image of %s %s.\n",
{
/* FIXME: should print MID and all that crap. */
printf_unfiltered ("\tUsing the running image of %s %s.\n",
- attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid));
+ attach_flag ? "attached" : "child", target_pid_to_str (inferior_p
t
id));
}
static void
}
static void
@@
-4224,11
+4227,7
@@
m3_open (char *arg, int from_tty)
}
#ifdef DUMP_SYSCALL
}
#ifdef DUMP_SYSCALL
-#ifdef __STDC__
#define STR(x) #x
#define STR(x) #x
-#else
-#define STR(x) "x"
-#endif
char *bsd1_names[] =
{
char *bsd1_names[] =
{
@@
-4464,7
+4463,7
@@
init_m3_ops (void)
m3_ops.to_attach = m3_attach;
m3_ops.to_detach = m3_detach;
m3_ops.to_resume = m3_resume;
m3_ops.to_attach = m3_attach;
m3_ops.to_detach = m3_detach;
m3_ops.to_resume = m3_resume;
- m3_ops.to_wait = mach_really_
_
wait;
+ m3_ops.to_wait = mach_really_wait;
m3_ops.to_fetch_registers = fetch_inferior_registers;
m3_ops.to_store_registers = store_inferior_registers;
m3_ops.to_prepare_to_store = m3_prepare_to_store;
m3_ops.to_fetch_registers = fetch_inferior_registers;
m3_ops.to_store_registers = store_inferior_registers;
m3_ops.to_prepare_to_store = m3_prepare_to_store;
@@
-4475,6
+4474,7
@@
init_m3_ops (void)
m3_ops.to_terminal_init = terminal_init_inferior;
m3_ops.to_terminal_inferior = terminal_inferior;
m3_ops.to_terminal_ours_for_output = terminal_ours_for_output;
m3_ops.to_terminal_init = terminal_init_inferior;
m3_ops.to_terminal_inferior = terminal_inferior;
m3_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+ m3_ops.to_terminal_save_ours = terminal_save_ours;
m3_ops.to_terminal_ours = terminal_ours;
m3_ops.to_terminal_info = child_terminal_info;
m3_ops.to_kill = m3_kill_inferior;
m3_ops.to_terminal_ours = terminal_ours;
m3_ops.to_terminal_info = child_terminal_info;
m3_ops.to_kill = m3_kill_inferior;
This page took
0.027017 seconds
and
4
git commands to generate.