set/show code-cache
[deliverable/binutils-gdb.git] / gdb / target.c
index 1c0134fe23879ab964a5faba1fb5e12a1cceba23..cc6194b3ba7b182a3499076b3d61d6a9c01e34f8 100644 (file)
@@ -21,8 +21,9 @@
 
 #include "defs.h"
 #include <errno.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "target.h"
+#include "target-dcache.h"
 #include "gdbcmd.h"
 #include "symtab.h"
 #include "inferior.h"
@@ -81,12 +82,6 @@ static LONGEST current_xfer_partial (struct target_ops *ops,
                                     const gdb_byte *writebuf,
                                     ULONGEST offset, LONGEST len);
 
-static LONGEST target_xfer_partial (struct target_ops *ops,
-                                   enum target_object object,
-                                   const char *annex,
-                                   void *readbuf, const void *writebuf,
-                                   ULONGEST offset, LONGEST len);
-
 static struct gdbarch *default_thread_architecture (struct target_ops *ops,
                                                    ptid_t ptid);
 
@@ -153,7 +148,6 @@ static void debug_to_stop (ptid_t);
    array.  */
 struct target_ops **target_structs;
 unsigned target_struct_size;
-unsigned target_struct_index;
 unsigned target_struct_allocsize;
 #define        DEFAULT_ALLOCSIZE       10
 
@@ -213,46 +207,6 @@ show_targetdebug (struct ui_file *file, int from_tty,
 
 static void setup_target_debug (void);
 
-/* The option sets this.  */
-static int stack_cache_enabled_p_1 = 1;
-/* And set_stack_cache_enabled_p updates this.
-   The reason for the separation is so that we don't flush the cache for
-   on->on transitions.  */
-static int stack_cache_enabled_p = 1;
-
-/* This is called *after* the stack-cache has been set.
-   Flush the cache for off->on and on->off transitions.
-   There's no real need to flush the cache for on->off transitions,
-   except cleanliness.  */
-
-static void
-set_stack_cache_enabled_p (char *args, int from_tty,
-                          struct cmd_list_element *c)
-{
-  if (stack_cache_enabled_p != stack_cache_enabled_p_1)
-    target_dcache_invalidate ();
-
-  stack_cache_enabled_p = stack_cache_enabled_p_1;
-}
-
-static void
-show_stack_cache_enabled_p (struct ui_file *file, int from_tty,
-                           struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Cache use for stack accesses is %s.\n"), value);
-}
-
-/* Cache of memory operations, to speed up remote access.  */
-static DCACHE *target_dcache;
-
-/* Invalidate the target dcache.  */
-
-void
-target_dcache_invalidate (void)
-{
-  dcache_invalidate (target_dcache);
-}
-
 /* The user just typed 'target' without the name of a target.  */
 
 static void
@@ -382,16 +336,12 @@ target_has_execution_current (void)
   return target_has_execution_1 (inferior_ptid);
 }
 
-/* Add possible target architecture T to the list and add a new
-   command 'target T->to_shortname'.  Set COMPLETER as the command's
-   completer if not NULL.  */
+/* Complete initialization of T.  This ensures that various fields in
+   T are set, if needed by the target implementation.  */
 
 void
-add_target_with_completer (struct target_ops *t,
-                          completer_ftype *completer)
+complete_target_initialization (struct target_ops *t)
 {
-  struct cmd_list_element *c;
-
   /* Provide default values for all "must have" methods.  */
   if (t->to_xfer_partial == NULL)
     t->to_xfer_partial = default_xfer_partial;
@@ -410,6 +360,19 @@ add_target_with_completer (struct target_ops *t,
 
   if (t->to_has_execution == NULL)
     t->to_has_execution = (int (*) (struct target_ops *, ptid_t)) return_zero;
+}
+
+/* Add possible target architecture T to the list and add a new
+   command 'target T->to_shortname'.  Set COMPLETER as the command's
+   completer if not NULL.  */
+
+void
+add_target_with_completer (struct target_ops *t,
+                          completer_ftype *completer)
+{
+  struct cmd_list_element *c;
+
+  complete_target_initialization (t);
 
   if (!target_structs)
     {
@@ -731,6 +694,7 @@ update_current_target (void)
       INHERIT (to_traceframe_info, t);
       INHERIT (to_use_agent, t);
       INHERIT (to_can_use_agent, t);
+      INHERIT (to_augmented_libraries_svr4_read, t);
       INHERIT (to_magic, t);
       INHERIT (to_supports_evaluation_of_breakpoint_conditions, t);
       INHERIT (to_can_run_breakpoint_commands, t);
@@ -946,7 +910,7 @@ update_current_target (void)
            (void (*) (LONGEST))
            target_ignore);
   de_fault (to_set_trace_notes,
-           (int (*) (char *, char *, char *))
+           (int (*) (const char *, const char *, const char *))
            return_zero);
   de_fault (to_get_tib_address,
            (int (*) (ptid_t, CORE_ADDR *))
@@ -962,7 +926,7 @@ update_current_target (void)
            tcomplain);
   de_fault (to_traceframe_info,
            (struct traceframe_info * (*) (void))
-           tcomplain);
+           return_zero);
   de_fault (to_supports_evaluation_of_breakpoint_conditions,
            (int (*) (void))
            return_zero);
@@ -975,6 +939,9 @@ update_current_target (void)
   de_fault (to_can_use_agent,
            (int (*) (void))
            return_zero);
+  de_fault (to_augmented_libraries_svr4_read,
+           (int (*) (void))
+           return_zero);
   de_fault (to_execution_direction, default_execution_direction);
 
 #undef de_fault
@@ -1081,26 +1048,11 @@ unpush_target (struct target_ops *t)
   return 1;
 }
 
-void
-pop_target (void)
-{
-  target_close (target_stack);         /* Let it clean up.  */
-  if (unpush_target (target_stack) == 1)
-    return;
-
-  fprintf_unfiltered (gdb_stderr,
-                     "pop_target couldn't find target %s\n",
-                     current_target.to_shortname);
-  internal_error (__FILE__, __LINE__,
-                 _("failed internal consistency check"));
-}
-
 void
 pop_all_targets_above (enum strata above_stratum)
 {
   while ((int) (current_target.to_stratum) > (int) above_stratum)
     {
-      target_close (target_stack);
       if (!unpush_target (target_stack))
        {
          fprintf_unfiltered (gdb_stderr,
@@ -1196,10 +1148,10 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
            case TLS_LOAD_MODULE_NOT_FOUND_ERROR:
              if (objfile_is_library)
                error (_("Cannot find shared library `%s' in dynamic"
-                        " linker's load module list"), objfile->name);
+                        " linker's load module list"), objfile_name (objfile));
              else
                error (_("Cannot find executable file `%s' in dynamic"
-                        " linker's load module list"), objfile->name);
+                        " linker's load module list"), objfile_name (objfile));
              break;
            case TLS_NOT_ALLOCATED_YET_ERROR:
              if (objfile_is_library)
@@ -1207,25 +1159,25 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
                         " thread-local variables in\n"
                         "the shared library `%s'\n"
                         "for %s"),
-                      objfile->name, target_pid_to_str (ptid));
+                      objfile_name (objfile), target_pid_to_str (ptid));
              else
                error (_("The inferior has not yet allocated storage for"
                         " thread-local variables in\n"
                         "the executable `%s'\n"
                         "for %s"),
-                      objfile->name, target_pid_to_str (ptid));
+                      objfile_name (objfile), target_pid_to_str (ptid));
              break;
            case TLS_GENERIC_ERROR:
              if (objfile_is_library)
                error (_("Cannot find thread-local storage for %s, "
                         "shared library %s:\n%s"),
                       target_pid_to_str (ptid),
-                      objfile->name, ex.message);
+                      objfile_name (objfile), ex.message);
              else
                error (_("Cannot find thread-local storage for %s, "
                         "executable file %s:\n%s"),
                       target_pid_to_str (ptid),
-                      objfile->name, ex.message);
+                      objfile_name (objfile), ex.message);
              break;
            default:
              throw_exception (ex);
@@ -1241,6 +1193,21 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
   return addr;
 }
 
+const char *
+target_xfer_error_to_string (enum target_xfer_error err)
+{
+#define CASE(X) case X: return #X
+  switch (err)
+    {
+      CASE(TARGET_XFER_E_IO);
+      CASE(TARGET_XFER_E_UNAVAILABLE);
+    default:
+      return "<unknown>";
+    }
+#undef CASE
+};
+
+
 #undef MIN
 #define MIN(A, B) (((A) <= (B)) ? (A) : (B))
 
@@ -1358,7 +1325,7 @@ static LONGEST
 target_read_live_memory (enum target_object object,
                         ULONGEST memaddr, gdb_byte *myaddr, LONGEST len)
 {
-  int ret;
+  LONGEST ret;
   struct cleanup *cleanup;
 
   /* Switch momentarily out of tfind mode so to access live memory.
@@ -1393,7 +1360,8 @@ memory_xfer_live_readonly_partial (struct target_ops *ops,
 
   secp = target_section_by_addr (ops, memaddr);
   if (secp != NULL
-      && (bfd_get_section_flags (secp->bfd, secp->the_bfd_section)
+      && (bfd_get_section_flags (secp->the_bfd_section->owner,
+                                secp->the_bfd_section)
          & SEC_READONLY))
     {
       struct target_section *p;
@@ -1472,7 +1440,8 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
 
       secp = target_section_by_addr (ops, memaddr);
       if (secp != NULL
-         && (bfd_get_section_flags (secp->bfd, secp->the_bfd_section)
+         && (bfd_get_section_flags (secp->the_bfd_section->owner,
+                                    secp->the_bfd_section)
              & SEC_READONLY))
        {
          table = target_get_section_table (ops);
@@ -1524,7 +1493,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
 
              /* No use trying further, we know some memory starting
                 at MEMADDR isn't available.  */
-             return -1;
+             return TARGET_XFER_E_UNAVAILABLE;
            }
 
          /* Don't try to read more than how much is available, in
@@ -1578,17 +1547,18 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
         the collected memory range fails.  */
       && get_traceframe_number () == -1
       && (region->attrib.cache
-         || (stack_cache_enabled_p && object == TARGET_OBJECT_STACK_MEMORY)))
+         || (stack_cache_enabled_p () && object == TARGET_OBJECT_STACK_MEMORY)
+         || (code_cache_enabled_p () && object == TARGET_OBJECT_CODE_MEMORY)))
     {
+      DCACHE *dcache = target_dcache_get_or_init ();
+
       if (readbuf != NULL)
-       res = dcache_xfer_memory (ops, target_dcache, memaddr, readbuf,
-                                 reg_len, 0);
+       res = dcache_xfer_memory (ops, dcache, memaddr, readbuf, reg_len, 0);
       else
        /* FIXME drow/2006-08-09: If we're going to preserve const
           correctness dcache_xfer_memory should take readbuf and
           writebuf.  */
-       res = dcache_xfer_memory (ops, target_dcache, memaddr,
-                                 (void *) writebuf,
+       res = dcache_xfer_memory (ops, dcache, memaddr, (void *) writebuf,
                                  reg_len, 1);
       if (res <= 0)
        return -1;
@@ -1629,11 +1599,14 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
   if (res > 0
       && inf != NULL
       && writebuf != NULL
+      && target_dcache_init_p ()
       && !region->attrib.cache
-      && stack_cache_enabled_p
-      && object != TARGET_OBJECT_STACK_MEMORY)
+      && ((stack_cache_enabled_p () && object != TARGET_OBJECT_STACK_MEMORY)
+         || (code_cache_enabled_p () && object != TARGET_OBJECT_CODE_MEMORY)))
     {
-      dcache_update (target_dcache, memaddr, (void *) writebuf, res);
+      DCACHE *dcache = target_dcache_get ();
+
+      dcache_update (dcache, memaddr, (void *) writebuf, res);
     }
 
   /* If we still haven't got anything, return the last error.  We
@@ -1670,6 +1643,13 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
       void *buf;
       struct cleanup *old_chain;
 
+      /* A large write request is likely to be partially satisfied
+        by memory_xfer_partial_1.  We will continually malloc
+        and free a copy of the entire write request for breakpoint
+        shadow handling even though we only end up writing a small
+        subset of it.  Cap writes to 4KB to mitigate this.  */
+      len = min (4096, len);
+
       buf = xmalloc (len);
       old_chain = make_cleanup (xfree, buf);
       memcpy (buf, writebuf, len);
@@ -1701,7 +1681,7 @@ make_show_memory_breakpoints_cleanup (int show)
 
 /* For docs see target.h, to_xfer_partial.  */
 
-static LONGEST
+LONGEST
 target_xfer_partial (struct target_ops *ops,
                     enum target_object object, const char *annex,
                     void *readbuf, const void *writebuf,
@@ -1718,7 +1698,8 @@ target_xfer_partial (struct target_ops *ops,
   /* If this is a memory transfer, let the memory-specific code
      have a look at it instead.  Memory transfers are more
      complicated.  */
-  if (object == TARGET_OBJECT_MEMORY || object == TARGET_OBJECT_STACK_MEMORY)
+  if (object == TARGET_OBJECT_MEMORY || object == TARGET_OBJECT_STACK_MEMORY
+      || object == TARGET_OBJECT_CODE_MEMORY)
     retval = memory_xfer_partial (ops, object, readbuf,
                                  writebuf, offset, len);
   else
@@ -1779,9 +1760,9 @@ target_xfer_partial (struct target_ops *ops,
   return retval;
 }
 
-/* Read LEN bytes of target memory at address MEMADDR, placing the results in
-   GDB's memory at MYADDR.  Returns either 0 for success or an errno value
-   if any error occurs.
+/* Read LEN bytes of target memory at address MEMADDR, placing the
+   results in GDB's memory at MYADDR.  Returns either 0 for success or
+   a target_xfer_error value if any error occurs.
 
    If an error occurs, no guarantee is made about the contents of the data at
    MYADDR.  In particular, the caller should not depend upon partial reads
@@ -1800,7 +1781,7 @@ target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
                   myaddr, memaddr, len) == len)
     return 0;
   else
-    return EIO;
+    return TARGET_XFER_E_IO;
 }
 
 /* Like target_read_memory, but specify explicitly that this is a read from
@@ -1817,13 +1798,27 @@ target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
                   myaddr, memaddr, len) == len)
     return 0;
   else
-    return EIO;
+    return TARGET_XFER_E_IO;
+}
+
+/* Like target_read_memory, but specify explicitly that this is a read from
+   the target's code.  This may trigger different cache behavior.  */
+
+int
+target_read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
+{
+  if (target_read (current_target.beneath, TARGET_OBJECT_CODE_MEMORY, NULL,
+                  myaddr, memaddr, len) == len)
+    return 0;
+  else
+    return TARGET_XFER_E_IO;
 }
 
 /* Write LEN bytes from MYADDR to target memory at address MEMADDR.
-   Returns either 0 for success or an errno value if any error occurs.
-   If an error occurs, no guarantee is made about how much data got written.
-   Callers that can deal with partial writes should call target_write.  */
+   Returns either 0 for success or a target_xfer_error value if any
+   error occurs.  If an error occurs, no guarantee is made about how
+   much data got written.  Callers that can deal with partial writes
+   should call target_write.  */
 
 int
 target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
@@ -1835,14 +1830,14 @@ target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
                    myaddr, memaddr, len) == len)
     return 0;
   else
-    return EIO;
+    return TARGET_XFER_E_IO;
 }
 
 /* Write LEN bytes from MYADDR to target raw memory at address
-   MEMADDR.  Returns either 0 for success or an errno value if any
-   error occurs.  If an error occurs, no guarantee is made about how
-   much data got written.  Callers that can deal with partial writes
-   should call target_write.  */
+   MEMADDR.  Returns either 0 for success or a target_xfer_error value
+   if any error occurs.  If an error occurs, no guarantee is made
+   about how much data got written.  Callers that can deal with
+   partial writes should call target_write.  */
 
 int
 target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
@@ -1854,7 +1849,7 @@ target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
                    myaddr, memaddr, len) == len)
     return 0;
   else
-    return EIO;
+    return TARGET_XFER_E_IO;
 }
 
 /* Fetch the target's memory map.  */
@@ -2432,7 +2427,7 @@ get_target_memory (struct target_ops *ops, CORE_ADDR addr, gdb_byte *buf,
      for this target).  */
   if (target_read (ops, TARGET_OBJECT_RAW_MEMORY, NULL, buf, addr, len)
       != len)
-    memory_error (EIO, addr);
+    memory_error (TARGET_XFER_E_IO, addr);
 }
 
 ULONGEST
@@ -2483,7 +2478,8 @@ target_info (char *args, int from_tty)
   int has_all_mem = 0;
 
   if (symfile_objfile != NULL)
-    printf_unfiltered (_("Symbols from \"%s\".\n"), symfile_objfile->name);
+    printf_unfiltered (_("Symbols from \"%s\".\n"),
+                      objfile_name (symfile_objfile));
 
   for (t = target_stack; t != NULL; t = t->beneath)
     {
@@ -2595,7 +2591,7 @@ target_preopen (int from_tty)
 /* Detach a target after doing deferred register stores.  */
 
 void
-target_detach (char *args, int from_tty)
+target_detach (const char *args, int from_tty)
 {
   struct target_ops* t;
   
@@ -2606,7 +2602,7 @@ target_detach (char *args, int from_tty)
   else
     /* If we're in breakpoints-always-inserted mode, have to remove
        them before detaching.  */
-    remove_breakpoints_pid (PIDGET (inferior_ptid));
+    remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
 
   prepare_for_detach ();
 
@@ -2669,8 +2665,8 @@ target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
              fprintf_unfiltered (gdb_stdlog,
                                  "target_wait (%d, status, options={%s})"
                                  " = %d,   %s\n",
-                                 PIDGET (ptid), options_string,
-                                 PIDGET (retval), status_string);
+                                 ptid_get_pid (ptid), options_string,
+                                 ptid_get_pid (retval), status_string);
              xfree (status_string);
              xfree (options_string);
            }
@@ -2724,7 +2720,7 @@ target_resume (ptid_t ptid, int step, enum gdb_signal signal)
          t->to_resume (t, ptid, step, signal);
          if (targetdebug)
            fprintf_unfiltered (gdb_stdlog, "target_resume (%d, %s, %s)\n",
-                               PIDGET (ptid),
+                               ptid_get_pid (ptid),
                                step ? "step" : "continue",
                                gdb_signal_to_name (signal));
 
@@ -2803,7 +2799,7 @@ target_program_signals (int numsigs, unsigned char *program_signals)
    follow forks.  */
 
 int
-target_follow_fork (int follow_child)
+target_follow_fork (int follow_child, int detach_fork)
 {
   struct target_ops *t;
 
@@ -2811,11 +2807,12 @@ target_follow_fork (int follow_child)
     {
       if (t->to_follow_fork != NULL)
        {
-         int retval = t->to_follow_fork (t, follow_child);
+         int retval = t->to_follow_fork (t, follow_child, detach_fork);
 
          if (targetdebug)
-           fprintf_unfiltered (gdb_stdlog, "target_follow_fork (%d) = %d\n",
-                               follow_child, retval);
+           fprintf_unfiltered (gdb_stdlog,
+                               "target_follow_fork (%d, %d) = %d\n",
+                               follow_child, detach_fork, retval);
          return retval;
        }
     }
@@ -3624,30 +3621,6 @@ return_minus_one (void)
   return -1;
 }
 
-/* Find a single runnable target in the stack and return it.  If for
-   some reason there is more than one, return NULL.  */
-
-struct target_ops *
-find_run_target (void)
-{
-  struct target_ops **t;
-  struct target_ops *runable = NULL;
-  int count;
-
-  count = 0;
-
-  for (t = target_structs; t < target_structs + target_struct_size; ++t)
-    {
-      if ((*t)->to_can_run && target_can_run (*t))
-       {
-         runable = *t;
-         ++count;
-       }
-    }
-
-  return (count == 1 ? runable : NULL);
-}
-
 /*
  * Find the next target down the stack from the specified target.
  */
@@ -3754,7 +3727,7 @@ init_dummy_target (void)
   dummy_target.to_doc = "";
   dummy_target.to_attach = find_default_attach;
   dummy_target.to_detach = 
-    (void (*)(struct target_ops *, char *, int))target_ignore;
+    (void (*)(struct target_ops *, const char *, int))target_ignore;
   dummy_target.to_create_inferior = find_default_create_inferior;
   dummy_target.to_can_async_p = find_default_can_async_p;
   dummy_target.to_is_async_p = find_default_is_async_p;
@@ -3791,6 +3764,8 @@ debug_to_open (char *args, int from_tty)
 void
 target_close (struct target_ops *targ)
 {
+  gdb_assert (!target_is_pushed (targ));
+
   if (targ->to_xclose != NULL)
     targ->to_xclose (targ);
   else if (targ->to_close != NULL)
@@ -3835,7 +3810,7 @@ target_thread_alive (ptid_t ptid)
          retval = t->to_thread_alive (t, ptid);
          if (targetdebug)
            fprintf_unfiltered (gdb_stdlog, "target_thread_alive (%d) = %d\n",
-                               PIDGET (ptid), retval);
+                               ptid_get_pid (ptid), retval);
 
          return retval;
        }
@@ -3882,52 +3857,6 @@ debug_to_post_attach (int pid)
   fprintf_unfiltered (gdb_stdlog, "target_post_attach (%d)\n", pid);
 }
 
-/* Return a pretty printed form of target_waitstatus.
-   Space for the result is malloc'd, caller must free.  */
-
-char *
-target_waitstatus_to_string (const struct target_waitstatus *ws)
-{
-  const char *kind_str = "status->kind = ";
-
-  switch (ws->kind)
-    {
-    case TARGET_WAITKIND_EXITED:
-      return xstrprintf ("%sexited, status = %d",
-                        kind_str, ws->value.integer);
-    case TARGET_WAITKIND_STOPPED:
-      return xstrprintf ("%sstopped, signal = %s",
-                        kind_str, gdb_signal_to_name (ws->value.sig));
-    case TARGET_WAITKIND_SIGNALLED:
-      return xstrprintf ("%ssignalled, signal = %s",
-                        kind_str, gdb_signal_to_name (ws->value.sig));
-    case TARGET_WAITKIND_LOADED:
-      return xstrprintf ("%sloaded", kind_str);
-    case TARGET_WAITKIND_FORKED:
-      return xstrprintf ("%sforked", kind_str);
-    case TARGET_WAITKIND_VFORKED:
-      return xstrprintf ("%svforked", kind_str);
-    case TARGET_WAITKIND_EXECD:
-      return xstrprintf ("%sexecd", kind_str);
-    case TARGET_WAITKIND_VFORK_DONE:
-      return xstrprintf ("%svfork-done", kind_str);
-    case TARGET_WAITKIND_SYSCALL_ENTRY:
-      return xstrprintf ("%sentered syscall", kind_str);
-    case TARGET_WAITKIND_SYSCALL_RETURN:
-      return xstrprintf ("%sexited syscall", kind_str);
-    case TARGET_WAITKIND_SPURIOUS:
-      return xstrprintf ("%sspurious", kind_str);
-    case TARGET_WAITKIND_IGNORE:
-      return xstrprintf ("%signore", kind_str);
-    case TARGET_WAITKIND_NO_HISTORY:
-      return xstrprintf ("%sno-history", kind_str);
-    case TARGET_WAITKIND_NO_RESUMED:
-      return xstrprintf ("%sno-resumed", kind_str);
-    default:
-      return xstrprintf ("%sunknown???", kind_str);
-    }
-}
-
 /* Concatenate ELEM to LIST, a comma separate list, and return the
    result.  The LIST incoming argument is released.  */
 
@@ -4068,7 +3997,7 @@ target_core_of_thread (ptid_t ptid)
          if (targetdebug)
            fprintf_unfiltered (gdb_stdlog,
                                "target_core_of_thread (%d) = %d\n",
-                               PIDGET (ptid), retval);
+                               ptid_get_pid (ptid), retval);
          return retval;
        }
     }
@@ -4222,7 +4151,10 @@ target_disable_btrace (struct btrace_target_info *btinfo)
 
   for (t = current_target.beneath; t != NULL; t = t->beneath)
     if (t->to_disable_btrace != NULL)
-      return t->to_disable_btrace (btinfo);
+      {
+       t->to_disable_btrace (btinfo);
+       return;
+      }
 
   tcomplain ();
 }
@@ -4236,7 +4168,10 @@ target_teardown_btrace (struct btrace_target_info *btinfo)
 
   for (t = current_target.beneath; t != NULL; t = t->beneath)
     if (t->to_teardown_btrace != NULL)
-      return t->to_teardown_btrace (btinfo);
+      {
+       t->to_teardown_btrace (btinfo);
+       return;
+      }
 
   tcomplain ();
 }
@@ -4807,7 +4742,7 @@ debug_to_post_startup_inferior (ptid_t ptid)
   debug_target.to_post_startup_inferior (ptid);
 
   fprintf_unfiltered (gdb_stdlog, "target_post_startup_inferior (%d)\n",
-                     PIDGET (ptid));
+                     ptid_get_pid (ptid));
 }
 
 static int
@@ -5044,7 +4979,7 @@ maintenance_print_target_stack (char *cmd, int from_tty)
 int target_async_permitted = 0;
 
 /* The set command writes to this variable.  If the inferior is
-   executing, linux_nat_async_permitted is *not* updated.  */
+   executing, target_async_permitted is *not* updated.  */
 static int target_async_permitted_1 = 0;
 
 static void
@@ -5173,17 +5108,6 @@ Tells gdb whether to control the inferior in asynchronous mode."),
                           &setlist,
                           &showlist);
 
-  add_setshow_boolean_cmd ("stack-cache", class_support,
-                          &stack_cache_enabled_p_1, _("\
-Set cache use for stack access."), _("\
-Show cache use for stack access."), _("\
-When on, use the data cache for all stack access, regardless of any\n\
-configured memory regions.  This improves remote performance significantly.\n\
-By default, caching for stack access is on."),
-                          set_stack_cache_enabled_p,
-                          show_stack_cache_enabled_p,
-                          &setlist, &showlist);
-
   add_setshow_boolean_cmd ("may-write-registers", class_support,
                           &may_write_registers_1, _("\
 Set permission to write into registers."), _("\
@@ -5237,7 +5161,4 @@ When this permission is on, GDB may interrupt/stop the target's execution.\n\
 Otherwise, any attempt to interrupt or stop will be ignored."),
                           set_target_permissions, NULL,
                           &setlist, &showlist);
-
-
-  target_dcache = dcache_init ();
 }
This page took 0.036161 seconds and 4 git commands to generate.