Small fix to gdb.Value constructor doc
[deliverable/binutils-gdb.git] / gdb / fbsd-nat.c
index b54240ae9c947eac7339844f6912894d6edfe7e1..184d63939f475c8bf6c01a90dca225eae3f11e91 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "byte-vector.h"
+#include "common/byte-vector.h"
 #include "gdbcore.h"
 #include "inferior.h"
 #include "regcache.h"
 #include "regset.h"
 #include "gdbcmd.h"
 #include "gdbthread.h"
-#include "gdb_wait.h"
+#include "common/gdb_wait.h"
 #include "inf-ptrace.h"
 #include <sys/types.h>
 #include <sys/procfs.h>
@@ -37,7 +37,7 @@
 #include <libutil.h>
 #endif
 #if !defined(HAVE_KINFO_GETVMMAP)
-#include "filestuff.h"
+#include "common/filestuff.h"
 #endif
 
 #include "elf-bfd.h"
@@ -231,6 +231,13 @@ fbsd_fetch_cmdline (pid_t pid)
   if (sysctl (mib, 4, cmdline.get (), &len, NULL, 0) == -1)
     return nullptr;
 
+  /* Join the arguments with spaces to form a single string.  */
+  char *cp = cmdline.get ();
+  for (size_t i = 0; i < len - 1; i++)
+    if (cp[i] == '\0')
+      cp[i] = ' ';
+  cp[len - 1] = '\0';
+
   return cmdline;
 }
 
This page took 0.108054 seconds and 4 git commands to generate.