gdb/
[deliverable/binutils-gdb.git] / gdb / target.c
index 32da4dd0e6cde079c45add2659011072a15f7a65..edf03f150a2e70f49ccdd134b3a9f7965f5c12a3 100644 (file)
@@ -634,6 +634,7 @@ update_current_target (void)
       /* Do not inherit to_find_new_threads.  */
       /* Do not inherit to_pid_to_str.  */
       INHERIT (to_extra_thread_info, t);
+      INHERIT (to_thread_name, t);
       INHERIT (to_stop, t);
       /* Do not inherit to_xfer_partial.  */
       INHERIT (to_rcmd, t);
@@ -680,6 +681,7 @@ update_current_target (void)
       INHERIT (to_set_permissions, t);
       INHERIT (to_static_tracepoint_marker_at, t);
       INHERIT (to_static_tracepoint_markers_by_strid, t);
+      INHERIT (to_traceframe_info, t);
       INHERIT (to_magic, t);
       /* Do not inherit to_memory_map.  */
       /* Do not inherit to_flash_erase.  */
@@ -804,6 +806,9 @@ update_current_target (void)
   de_fault (to_extra_thread_info,
            (char *(*) (struct thread_info *))
            return_zero);
+  de_fault (to_thread_name,
+           (char *(*) (struct thread_info *))
+           return_zero);
   de_fault (to_stop,
            (void (*) (ptid_t))
            target_ignore);
@@ -886,6 +891,9 @@ update_current_target (void)
   de_fault (to_static_tracepoint_markers_by_strid,
            (VEC(static_tracepoint_marker_p) * (*) (const char *))
            tcomplain);
+  de_fault (to_traceframe_info,
+           (struct traceframe_info * (*) (void))
+           tcomplain);
 #undef de_fault
 
   /* Finally, position the target-stack beneath the squashed
@@ -1410,7 +1418,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
     }
   while (ops != NULL);
 
-  if (readbuf && !show_memory_breakpoints)
+  if (res > 0 && readbuf != NULL && !show_memory_breakpoints)
     breakpoint_restore_shadows (readbuf, memaddr, reg_len);
 
   /* Make sure the cache gets updated no matter what - if we are writing
@@ -2407,6 +2415,20 @@ target_pid_to_str (ptid_t ptid)
   return normal_pid_to_str (ptid);
 }
 
+char *
+target_thread_name (struct thread_info *info)
+{
+  struct target_ops *t;
+
+  for (t = current_target.beneath; t != NULL; t = t->beneath)
+    {
+      if (t->to_thread_name != NULL)
+       return (*t->to_thread_name) (info);
+    }
+
+  return NULL;
+}
+
 void
 target_resume (ptid_t ptid, int step, enum target_signal signal)
 {
This page took 0.027093 seconds and 4 git commands to generate.