aboutsummaryrefslogtreecommitdiff
path: root/gdb/gnu-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gnu-nat.c')
-rw-r--r--gdb/gnu-nat.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 7f1614c..dd639fe 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -1,5 +1,5 @@
/* Interface GDB to the GNU Hurd.
- Copyright (C) 1992-2024 Free Software Foundation, Inc.
+ Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -1016,15 +1016,16 @@ gnu_nat_target::inf_validate_procs (struct inf *inf)
{
/* Make things normally linear. */
mach_msg_type_number_t search_start = 0;
- /* Which thread in PROCS corresponds to each task thread, & the task. */
- struct proc *matched[num_threads + 1];
+
+ /* Which thread in PROCS corresponds to each task thread. */
+ std::vector<struct proc *> matched (num_threads);
+
/* The last thread in INF->threads, so we can add to the end. */
struct proc *last = 0;
+
/* The current thread we're considering. */
struct proc *thread = inf->threads;
- memset (matched, 0, sizeof (matched));
-
while (thread)
{
mach_msg_type_number_t left;
@@ -1221,7 +1222,7 @@ inf_update_signal_thread (struct inf *inf)
}
-/* Detachs from INF's inferior task, letting it run once again... */
+/* Detach from INF's inferior task, letting it run once again... */
void
gnu_nat_target::inf_detach (struct inf *inf)
{
@@ -2172,7 +2173,7 @@ gnu_nat_target::attach (const char *args, int from_tty)
pid = parse_pid_to_attach (args);
- if (pid == getpid ()) /* Trying to masturbate? */
+ if (pid == getpid ())
error (_("I refuse to debug myself!"));
target_announce_attach (from_tty, pid);
@@ -3433,9 +3434,7 @@ to the thread's initial suspend-count when gdb notices the threads."),
&thread_cmd_list);
}
-void _initialize_gnu_nat ();
-void
-_initialize_gnu_nat ()
+INIT_GDB_FILE (gnu_nat)
{
proc_server = getproc ();