]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: export cb_get_string for people to use
authorMike Frysinger <vapier@gentoo.org>
Sat, 3 Dec 2011 18:39:43 +0000 (18:39 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 3 Dec 2011 18:39:43 +0000 (18:39 +0000)
The common sim code provides a useful "get_string" function which reads
a C string out of the target's memory space.  So rename and export it
for other people to use.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
include/gdb/ChangeLog
include/gdb/callback.h
sim/common/ChangeLog
sim/common/syscall.c

index dabaa5b19e0df8d455a06761d7b93424c40bcd16..9ce3db9141665eb47df388028e5adbbf286c218e 100644 (file)
@@ -1,3 +1,7 @@
+2011-12-03  Mike Frysinger  <vapier@gentoo.org>
+
+       * callback.h (cb_get_string): New prototype.
+
 2011-04-14  Mike Frysinger  <vapier@gentoo.org>
 
        * remote-sim.h (sim_complete_command): New prototype.
index a1f79f94de4e3c131b43d5fd035e9463bff6f0ee..bbc5bb3481b521e66a0b0cfd64747c70e11fb5a2 100644 (file)
@@ -324,6 +324,9 @@ int cb_is_stdin (host_callback *, int);
 int cb_is_stdout (host_callback *, int);
 int cb_is_stderr (host_callback *, int);
 
+/* Read a string out of the target.  */
+int cb_get_string (host_callback *, CB_SYSCALL *, char *, int, unsigned long);
+
 /* Perform a system call.  */
 CB_RC cb_syscall (host_callback *, CB_SYSCALL *);
 
index 405888fdd3eeb76825201ef395e406f272132d48..c69b94864b8220e5af5c5b96b1fa03a07c431b2e 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-03  Mike Frysinger  <vapier@gentoo.org>
+
+       * syscall.c (cb_get_string): Rename from "get_string".
+       (get_path): Rename get_string call to cb_get_string.
+
 2011-12-03  Mike Frysinger  <vapier@gentoo.org>
 
        * Make-common.in (VPATH): Add $(srccom).
index 28816c02b55836d4491e9eb6bb899b64eeb59587..1dfe7aabaab55a84052a18ccc39eb2af7caf3b4a 100644 (file)
@@ -76,8 +76,8 @@ char *simulator_sysroot = "";
 /* Utility of cb_syscall to fetch a path name or other string from the target.
    The result is 0 for success or a host errno value.  */
 
-static int
-get_string (cb, sc, buf, buflen, addr)
+int
+cb_get_string (cb, sc, buf, buflen, addr)
      host_callback *cb;
      CB_SYSCALL *sc;
      char *buf;
@@ -121,7 +121,7 @@ get_path (cb, sc, addr, bufp)
   int result;
   int sysroot_len = strlen (simulator_sysroot);
 
-  result = get_string (cb, sc, buf, MAX_PATH_LEN - sysroot_len, addr);
+  result = cb_get_string (cb, sc, buf, MAX_PATH_LEN - sysroot_len, addr);
   if (result == 0)
     {
       /* Prepend absolute paths with simulator_sysroot.  Relative paths