gdb/gdbserver:
authorYao Qi <yao@codesourcery.com>
Fri, 9 Nov 2012 02:58:50 +0000 (02:58 +0000)
committerYao Qi <yao@codesourcery.com>
Fri, 9 Nov 2012 02:58:50 +0000 (02:58 +0000)
2012-11-09  Yao Qi  <yao@codesourcery.com>

* spu-low.c (current_ptid): Move it to ..
* gdbthread.h: ... here.  New.
* remote-utils.c (read_ptid): Use macro 'current_ptid'.
* server.c (myresume, process_serial_event): Likewise.
* thread-db.c (thread_db_find_new_threads): Likewise.
* tracepoint.c (run_inferior_command): Likewise.

gdb/gdbserver/ChangeLog
gdb/gdbserver/gdbthread.h
gdb/gdbserver/remote-utils.c
gdb/gdbserver/server.c
gdb/gdbserver/spu-low.c
gdb/gdbserver/thread-db.c
gdb/gdbserver/tracepoint.c

index 8bfbe9cb510a0d84622d091e38c34d103051ad8c..a36669541d35e6e2df50d7ad646a710a745d255a 100644 (file)
@@ -1,3 +1,12 @@
+2012-11-09  Yao Qi  <yao@codesourcery.com>
+
+       * spu-low.c (current_ptid): Move it to ..
+       * gdbthread.h: ... here.  New.
+       * remote-utils.c (read_ptid): Use macro 'current_ptid'.
+       * server.c (myresume, process_serial_event): Likewise.
+       * thread-db.c (thread_db_find_new_threads): Likewise.
+       * tracepoint.c (run_inferior_command): Likewise.
+
 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
 
        * server.c (handle_search_memory_1): Include access length in
index d863ec00104b38c262099c654e992f95da8fde7a..adc23da6423b0492688dc065e274e8aff8b441ce 100644 (file)
@@ -68,4 +68,6 @@ void add_thread (ptid_t ptid, void *target_data);
 struct thread_info *find_thread_ptid (ptid_t ptid);
 struct thread_info *gdb_id_to_thread (unsigned int);
 
+/* Get current thread ID (Linux task ID).  */
+#define current_ptid ((struct inferior_list_entry *) current_inferior)->id
 #endif /* GDB_THREAD_H */
index 0b3adace79c55a5bb970d654a499cd7ac0d75777..63a3e80e60fb48cff0009a98c04e724273e4bf63 100644 (file)
@@ -761,7 +761,7 @@ read_ptid (char *buf, char **obuf)
 
   /* Since the stub is not sending a process id, then default to
      what's in the current inferior.  */
-  pid = ptid_get_pid (((struct inferior_list_entry *) current_inferior)->id);
+  pid = ptid_get_pid (current_ptid);
 
   if (obuf)
     *obuf = pp;
index 61a731304152c54e6597053b4e50ba1c58f7d56b..c611b7d90fa5d77aea57eaa93f174ac81ba1c03a 100644 (file)
@@ -2283,8 +2283,7 @@ myresume (char *own_buf, int step, int sig)
 
   if (step || sig || valid_cont_thread)
     {
-      resume_info[0].thread
-       = ((struct inferior_list_entry *) current_inferior)->id;
+      resume_info[0].thread = current_ptid;
       if (step)
        resume_info[0].kind = resume_step;
       else
@@ -3006,8 +3005,7 @@ process_serial_event (void)
          pid = strtol (&own_buf[i], NULL, 16);
        }
       else
-       pid =
-         ptid_get_pid (((struct inferior_list_entry *) current_inferior)->id);
+       pid = ptid_get_pid (current_ptid);
 
       if ((tracing && disconnected_tracing) || any_persistent_commands ())
        {
index d7283a9703f90d215ec1aa4f8181a5e5df158a43..2265fad23f6732ff6a8129d4a83782ad5c30c121 100644 (file)
@@ -51,9 +51,6 @@
 #define INSTR_SC       0x44000002
 #define NR_spu_run     0x0116
 
-/* Get current thread ID (Linux task ID).  */
-#define current_ptid ((struct inferior_list_entry *)current_inferior)->id
-
 /* These are used in remote-utils.c.  */
 int using_threads = 0;
 
index 4a59df613c1a380cee9e73db3cad052854013797..9d2041dae644b89d657d11e8f125bfc693625c6c 100644 (file)
@@ -406,7 +406,7 @@ static void
 thread_db_find_new_threads (void)
 {
   td_err_e err;
-  ptid_t ptid = ((struct inferior_list_entry *) current_inferior)->id;
+  ptid_t ptid = current_ptid;
   struct thread_db *thread_db = current_process ()->private->thread_db;
   int loop, iteration;
 
index 201a25b384e35f60f8a64cab8334f055cfb27d3e..15268389c553e8c6b79c96ee604f64bff13845b9 100644 (file)
@@ -6692,7 +6692,7 @@ static int
 run_inferior_command (char *cmd, int len)
 {
   int err = -1;
-  int pid = ptid_get_pid (current_inferior->entry.id);
+  int pid = ptid_get_pid (current_ptid);
 
   trace_debug ("run_inferior_command: running: %s", cmd);