projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ubsan: z8k: index 10 out of bounds for type 'unsigned int const[10]'
[deliverable/binutils-gdb.git]
/
gdb
/
fbsd-nat.c
diff --git
a/gdb/fbsd-nat.c
b/gdb/fbsd-nat.c
index 712f9d3b7b8f3413b7a0d832065b2694f63a5af8..f0f1e791cbd2f5fe01438c83968800e5b955667e 100644
(file)
--- a/
gdb/fbsd-nat.c
+++ b/
gdb/fbsd-nat.c
@@
-1,6
+1,6
@@
/* Native-dependent code for FreeBSD.
/* Native-dependent code for FreeBSD.
- Copyright (C) 2002-20
19
Free Software Foundation, Inc.
+ Copyright (C) 2002-20
20
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-18,14
+18,15
@@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "
common
/byte-vector.h"
+#include "
gdbsupport
/byte-vector.h"
#include "gdbcore.h"
#include "inferior.h"
#include "regcache.h"
#include "regset.h"
#include "gdbcore.h"
#include "inferior.h"
#include "regcache.h"
#include "regset.h"
+#include "gdbarch.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "gdbcmd.h"
#include "gdbthread.h"
-#include "
common
/gdb_wait.h"
+#include "
gdbsupport
/gdb_wait.h"
#include "inf-ptrace.h"
#include <sys/types.h>
#include <sys/procfs.h>
#include "inf-ptrace.h"
#include <sys/types.h>
#include <sys/procfs.h>
@@
-37,7
+38,7
@@
#include <libutil.h>
#endif
#if !defined(HAVE_KINFO_GETVMMAP)
#include <libutil.h>
#endif
#if !defined(HAVE_KINFO_GETVMMAP)
-#include "
common
/filestuff.h"
+#include "
gdbsupport
/filestuff.h"
#endif
#include "elf-bfd.h"
#endif
#include "elf-bfd.h"
@@
-231,6
+232,13
@@
fbsd_fetch_cmdline (pid_t pid)
if (sysctl (mib, 4, cmdline.get (), &len, NULL, 0) == -1)
return nullptr;
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;
}
return cmdline;
}
@@
-824,8
+832,8
@@
fbsd_nat_target::xfer_partial (enum target_object object,
}
#ifdef PT_LWPINFO
}
#ifdef PT_LWPINFO
-static
int
debug_fbsd_lwp;
-static
int
debug_fbsd_nat;
+static
bool
debug_fbsd_lwp;
+static
bool
debug_fbsd_nat;
static void
show_fbsd_lwp_debug (struct ui_file *file, int from_tty,
static void
show_fbsd_lwp_debug (struct ui_file *file, int from_tty,
@@
-890,10
+898,9
@@
fbsd_nat_target::thread_alive (ptid_t ptid)
return true;
}
return true;
}
-/* Convert PTID to a string. Returns the string in a static
- buffer. */
+/* Convert PTID to a string. */
-const char *
+std::string
fbsd_nat_target::pid_to_str (ptid_t ptid)
{
lwpid_t lwp;
fbsd_nat_target::pid_to_str (ptid_t ptid)
{
lwpid_t lwp;
@@
-901,11
+908,9
@@
fbsd_nat_target::pid_to_str (ptid_t ptid)
lwp = ptid.lwp ();
if (lwp != 0)
{
lwp = ptid.lwp ();
if (lwp != 0)
{
- static char buf[64];
int pid = ptid.pid ();
int pid = ptid.pid ();
- xsnprintf (buf, sizeof buf, "LWP %d of process %d", lwp, pid);
- return buf;
+ return string_printf ("LWP %d of process %d", lwp, pid);
}
return normal_pid_to_str (ptid);
}
return normal_pid_to_str (ptid);
@@
-1343,8
+1348,8
@@
fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
"FLWP: deleting thread for LWP %u\n",
pl.pl_lwpid);
if (print_thread_events)
"FLWP: deleting thread for LWP %u\n",
pl.pl_lwpid);
if (print_thread_events)
- printf_unfiltered (_("[%s exited]\n"),
target_pid_to_str
-
(wptid
));
+ printf_unfiltered (_("[%s exited]\n"),
+
target_pid_to_str (wptid).c_str (
));
delete_thread (thr);
}
if (ptrace (PT_CONTINUE, pid, (caddr_t) 1, 0) == -1)
delete_thread (thr);
}
if (ptrace (PT_CONTINUE, pid, (caddr_t) 1, 0) == -1)
This page took
0.025102 seconds
and
4
git commands to generate.