diff options
author | Pedro Alves <palves@redhat.com> | 2008-08-08 02:34:10 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-08-08 02:34:10 +0000 |
commit | e5ef4d7558872f9f1987c3982ee7d7c9fdb5a6e0 (patch) | |
tree | ea5831b18051fa5d2994048b92438cc491d72acb /gdb/remote-m32r-sdi.c | |
parent | e052e704704f48d0d51abba8bdb715b738f76c51 (diff) | |
download | gdb-e5ef4d7558872f9f1987c3982ee7d7c9fdb5a6e0.zip gdb-e5ef4d7558872f9f1987c3982ee7d7c9fdb5a6e0.tar.gz gdb-e5ef4d7558872f9f1987c3982ee7d7c9fdb5a6e0.tar.bz2 |
* remote-m32r-sdi.c: Include "gdbthread.h".
(remote_m32r_ptid): New.
(m32r_close): Delete the main thread.
(m32r_resume): Set inferior_ptid toA remote_m32r_ptid. Add the
main thread.
(m32r_kill, m32r_load, sdireset_command): Delete the main thread.
(_initialize_remote_m32r): Initialize remote_m32r_ptid.
Diffstat (limited to 'gdb/remote-m32r-sdi.c')
-rw-r--r-- | gdb/remote-m32r-sdi.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index c048c5b..a8f095c 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -28,6 +28,7 @@ #include "target.h" #include "regcache.h" #include "gdb_string.h" +#include "gdbthread.h" #include <ctype.h> #include <signal.h> #ifdef __MINGW32__ @@ -84,6 +85,11 @@ static int interrupted = 0; /* Forward data declarations */ extern struct target_ops m32r_ops; +/* This is the ptid we use while we're connected to the remote. Its + value is arbitrary, as the target doesn't have a notion of + processes or threads, but we need something non-null to place in + inferior_ptid. */ +static ptid_t remote_m32r_ptid; /* Commands */ #define SDI_OPEN 1 @@ -432,6 +438,7 @@ m32r_close (int quitting) } inferior_ptid = null_ptid; + delete_thread_silent (remote_m32r_ptid); return; } @@ -667,7 +674,8 @@ m32r_resume (ptid_t ptid, int step, enum target_signal sig) target is active. These functions should be split out into seperate variables, especially since GDB will someday have a notion of debugging several processes. */ - inferior_ptid = pid_to_ptid (32); + inferior_ptid = remote_m32r_ptid; + add_thread_silent (remote_m32r_ptid); return; } @@ -1127,6 +1135,7 @@ m32r_kill (void) fprintf_unfiltered (gdb_stdlog, "m32r_kill()\n"); inferior_ptid = null_ptid; + delete_thread_silent (remote_m32r_ptid); return; } @@ -1366,6 +1375,7 @@ m32r_load (char *args, int from_tty) write_pc (bfd_get_start_address (exec_bfd)); inferior_ptid = null_ptid; /* No process now */ + delete_thread_silent (remote_m32r_ptid); /* This is necessary because many things were based on the PC at the time that we attached to the monitor, which is no longer valid now that we @@ -1490,6 +1500,7 @@ sdireset_command (char *args, int from_tty) send_cmd (SDI_OPEN); inferior_ptid = null_ptid; + delete_thread_silent (remote_m32r_ptid); } @@ -1648,4 +1659,8 @@ _initialize_remote_m32r (void) _("Set breakpoints by IB break.")); add_com ("use_dbt_break", class_obscure, use_dbt_breakpoints_command, _("Set breakpoints by dbt.")); + + /* Yes, 42000 is arbitrary. The only sense out of it, is that it + isn't 0. */ + remote_m32r_ptid = ptid_build (42000, 0, 42000); } |