aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-08-08 02:45:11 +0000
committerPedro Alves <palves@redhat.com>2008-08-08 02:45:11 +0000
commit4d6c6261a1ae337658ca23b095b2fd610b1615b2 (patch)
tree5a4d8aafdc87a13a447faa1c478c3d2bcd1f5841 /gdb
parente5ef4d7558872f9f1987c3982ee7d7c9fdb5a6e0 (diff)
downloadgdb-4d6c6261a1ae337658ca23b095b2fd610b1615b2.zip
gdb-4d6c6261a1ae337658ca23b095b2fd610b1615b2.tar.gz
gdb-4d6c6261a1ae337658ca23b095b2fd610b1615b2.tar.bz2
* remote-m32r-sdi.c (m32r_thread_alive, m32r_pid_to_str): New.
(init_m32r_ops): Register m32r_thread_alive and m32r_pid_to_str.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/remote-m32r-sdi.c30
2 files changed, 35 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6df70f2..5317a08 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2008-08-08 Pedro Alves <pedro@codesourcery.com>
+ * remote-m32r-sdi.c (m32r_thread_alive, m32r_pid_to_str): New.
+ (init_m32r_ops): Register m32r_thread_alive and m32r_pid_to_str.
+
+2008-08-08 Pedro Alves <pedro@codesourcery.com>
+
* remote-m32r-sdi.c: Include "gdbthread.h".
(remote_m32r_ptid): New.
(m32r_close): Delete the main thread.
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index a8f095c..1caff52 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -1490,6 +1490,34 @@ m32r_stopped_by_watchpoint (void)
return m32r_stopped_data_address (&current_target, &addr);
}
+/* Check to see if a thread is still alive. */
+
+static int
+m32r_thread_alive (ptid_t ptid)
+{
+ if (ptid_equal (ptid, remote_m32r_ptid))
+ /* The main task is always alive. */
+ return 1;
+
+ return 0;
+}
+
+/* Convert a thread ID to a string. Returns the string in a static
+ buffer. */
+
+static char *
+m32r_pid_to_str (ptid_t ptid)
+{
+ static char buf[64];
+
+ if (ptid_equal (remote_m32r_ptid, ptid))
+ {
+ xsnprintf (buf, sizeof buf, "Thread <main>");
+ return buf;
+ }
+
+ return normal_pid_to_str (ptid);
+}
static void
sdireset_command (char *args, int from_tty)
@@ -1612,6 +1640,8 @@ init_m32r_ops (void)
m32r_ops.to_mourn_inferior = m32r_mourn_inferior;
m32r_ops.to_stop = m32r_stop;
m32r_ops.to_log_command = serial_log_command;
+ m32r_ops.to_thread_alive = m32r_thread_alive;
+ m32r_ops.to_pid_to_str = m32r_pid_to_str;
m32r_ops.to_stratum = process_stratum;
m32r_ops.to_has_all_memory = 1;
m32r_ops.to_has_memory = 1;