Handle var_zuinteger and var_zuinteger_unlimited from Python
[deliverable/binutils-gdb.git] / gdb / inf-child.c
index ada570d96f6e41d5ca93c0acf521c548039b1906..c7c45530b6bc38a54e60c55e258ec0c3ac2e4ee7 100644 (file)
@@ -1,6 +1,6 @@
 /* Base/prototype target for default child (native) targets.
 
-   Copyright (C) 1988-2015 Free Software Foundation, Inc.
+   Copyright (C) 1988-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -77,7 +77,7 @@ inf_child_fetch_inferior_registers (struct target_ops *ops,
   if (regnum == -1)
     {
       for (regnum = 0;
-          regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+          regnum < gdbarch_num_regs (regcache->arch ());
           regnum++)
        regcache_raw_supply (regcache, regnum, NULL);
     }
@@ -333,7 +333,7 @@ inf_child_fileio_unlink (struct target_ops *self,
 
 /* Implementation of to_fileio_readlink.  */
 
-static char *
+static gdb::optional<std::string>
 inf_child_fileio_readlink (struct target_ops *self,
                           struct inferior *inf, const char *filename,
                           int *target_errno)
@@ -343,22 +343,18 @@ inf_child_fileio_readlink (struct target_ops *self,
 #if defined (PATH_MAX)
   char buf[PATH_MAX];
   int len;
-  char *ret;
 
   len = readlink (filename, buf, sizeof buf);
   if (len < 0)
     {
       *target_errno = host_to_fileio_error (errno);
-      return NULL;
+      return {};
     }
 
-  ret = xmalloc (len + 1);
-  memcpy (ret, buf, len);
-  ret[len] = '\0';
-  return ret;
+  return std::string (buf, len);
 #else
   *target_errno = FILEIO_ENOSYS;
-  return NULL;
+  return {};
 #endif
 }
 
@@ -408,9 +404,12 @@ inf_child_target (void)
   t->to_remove_breakpoint = memory_remove_breakpoint;
   t->to_terminal_init = child_terminal_init;
   t->to_terminal_inferior = child_terminal_inferior;
+  t->to_terminal_save_inferior = child_terminal_save_inferior;
   t->to_terminal_ours_for_output = child_terminal_ours_for_output;
   t->to_terminal_ours = child_terminal_ours;
   t->to_terminal_info = child_terminal_info;
+  t->to_pass_ctrlc = child_pass_ctrlc;
+  t->to_interrupt = child_interrupt;
   t->to_post_startup_inferior = inf_child_post_startup_inferior;
   t->to_follow_fork = inf_child_follow_fork;
   t->to_can_run = inf_child_can_run;
This page took 0.02439 seconds and 4 git commands to generate.