+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
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 */
/* 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;
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
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 ())
{
#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;
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;
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);