gdb/gdbserver/
authorYao Qi <yao@codesourcery.com>
Thu, 19 Apr 2012 05:05:11 +0000 (05:05 +0000)
committerYao Qi <yao@codesourcery.com>
Thu, 19 Apr 2012 05:05:11 +0000 (05:05 +0000)
* remote-utils.c (prepare_resume_reply): Replace with macro
target_core_of_thread.
* server.c (handle_qxfer_threads_proper): Likewise.
* target.h (traget_core_of_thread): New macro.

gdb/gdbserver/ChangeLog
gdb/gdbserver/remote-utils.c
gdb/gdbserver/server.c
gdb/gdbserver/target.h

index 1c9b9d8c5c5acc5278798614df50a7fae53d3f33..d238062beef101bd66b3e5fc7664a02d7694388f 100644 (file)
@@ -1,3 +1,10 @@
+2012-04-19  Yao Qi  <yao@codesourcery.com>
+
+       * remote-utils.c (prepare_resume_reply): Replace with macro
+       target_core_of_thread.
+       * server.c (handle_qxfer_threads_proper): Likewise.
+       * target.h (traget_core_of_thread): New macro.
+
 2012-04-16  Yao Qi  <yao@codesourcery.com>
 
        * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
index 4e35bb7c64b15dacd0dae77d04bd81d50d3a5016..995e3b1074e53ec2a481b6208b748e9060697a94 100644 (file)
@@ -1390,8 +1390,8 @@ prepare_resume_reply (char *buf, ptid_t ptid,
                strcat (buf, ";");
                buf += strlen (buf);
 
-               if (the_target->core_of_thread)
-                 core = (*the_target->core_of_thread) (ptid);
+               core = target_core_of_thread (ptid);
+
                if (core != -1)
                  {
                    sprintf (buf, "core:");
index 9c7159f3d529b1b27da77d2d126057f91186e08e..23c9d47c3b5cdc7bbfe33880eccf23810db84bc1 100644 (file)
@@ -1161,14 +1161,11 @@ handle_qxfer_threads_proper (struct buffer *buffer)
     {
       ptid_t ptid = thread_to_gdb_id ((struct thread_info *)thread);
       char ptid_s[100];
-      int core = -1;
+      int core = target_core_of_thread (ptid);
       char core_s[21];
 
       write_ptid (ptid_s, ptid);
 
-      if (the_target->core_of_thread)
-       core = (*the_target->core_of_thread) (ptid);
-
       if (core != -1)
        {
          sprintf (core_s, "%d", core);
index 256cfd9049074808c63e4154fede97d4a527f8a1..dcf02306c89b00ba489054db5810c7fd1f73641c 100644 (file)
@@ -540,6 +540,10 @@ ptid_t mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
        (*the_target->done_accessing_memory) ();        \
     } while (0)
 
+#define target_core_of_thread(ptid)            \
+  (the_target->core_of_thread ? (*the_target->core_of_thread) (ptid) \
+   : -1)
+
 int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len);
 
 int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,