Index: devel/gdb/Makefile =================================================================== --- devel/gdb/Makefile +++ devel/gdb/Makefile @@ -3,6 +3,7 @@ PORTNAME= gdb PORTVERSION= 7.9.1 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= GNU @@ -17,7 +18,7 @@ GNU_CONFIGURE= yes CONFIGURE_ENV= CONFIGURED_M4=m4 CONFIGURED_BISON=byacc CONFIGURE_ARGS= --program-suffix=${PORTVERSION:S/.//g} \ - --enable-targets=all \ + --enable-targets=all --enable-64-bit-bfd \ --with-gdb-datadir=${PREFIX}/share/gdb${PORTVERSION:S/.//g} \ --with-separate-debug-dir=/usr/lib/debug \ ${ICONV_CONFIGURE_ARG} \ @@ -31,7 +32,12 @@ ${FILESDIR}/commit-773eacf \ ${FILESDIR}/commit-2526815 \ ${FILESDIR}/commit-3ce5b6e \ - ${FILESDIR}/commit-97de354 + ${FILESDIR}/commit-97de354 \ + ${FILESDIR}/commit-79639e1 \ + ${FILESDIR}/commit-8f60fe0 \ + ${FILESDIR}/commit-e58e05d \ + ${FILESDIR}/commit-d2b41ca \ + ${FILESDIR}/commit-cea6e4f VER= ${PORTVERSION:S/.//g} PLIST_SUB= VER=${VER} Index: devel/gdb/files/commit-79639e1 =================================================================== --- /dev/null +++ devel/gdb/files/commit-79639e1 @@ -0,0 +1,136 @@ +diff --git gdb/infrun.c gdb/infrun.c +index f87ed4c..abfeeee 100644 +--- gdb/infrun.c ++++ gdb/infrun.c +@@ -408,15 +408,12 @@ static int + follow_fork_inferior (int follow_child, int detach_fork) + { + int has_vforked; +- int parent_pid, child_pid; ++ ptid_t parent_ptid, child_ptid; + + has_vforked = (inferior_thread ()->pending_follow.kind + == TARGET_WAITKIND_VFORKED); +- parent_pid = ptid_get_lwp (inferior_ptid); +- if (parent_pid == 0) +- parent_pid = ptid_get_pid (inferior_ptid); +- child_pid +- = ptid_get_pid (inferior_thread ()->pending_follow.value.related_pid); ++ parent_ptid = inferior_ptid; ++ child_ptid = inferior_thread ()->pending_follow.value.related_pid; + + if (has_vforked + && !non_stop /* Non-stop always resumes both branches. */ +@@ -460,10 +457,9 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + { + target_terminal_ours_for_output (); + fprintf_filtered (gdb_stdlog, +- _("Detaching after %s from " +- "child process %d.\n"), ++ _("Detaching after %s from child %s.\n"), + has_vforked ? "vfork" : "fork", +- child_pid); ++ target_pid_to_str (child_ptid)); + } + } + else +@@ -472,7 +468,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + struct cleanup *old_chain; + + /* Add process to GDB's tables. */ +- child_inf = add_inferior (child_pid); ++ child_inf = add_inferior (ptid_get_pid (child_ptid)); + + parent_inf = current_inferior (); + child_inf->attach_flag = parent_inf->attach_flag; +@@ -483,7 +479,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + old_chain = save_inferior_ptid (); + save_current_program_space (); + +- inferior_ptid = ptid_build (child_pid, child_pid, 0); ++ inferior_ptid = child_ptid; + add_thread (inferior_ptid); + child_inf->symfile_flags = SYMFILE_NO_READ; + +@@ -549,17 +545,16 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + { + target_terminal_ours_for_output (); + fprintf_filtered (gdb_stdlog, +- _("Attaching after process %d " +- "%s to child process %d.\n"), +- parent_pid, ++ _("Attaching after %s %s to child %s.\n"), ++ target_pid_to_str (parent_ptid), + has_vforked ? "vfork" : "fork", +- child_pid); ++ target_pid_to_str (child_ptid)); + } + + /* Add the new inferior first, so that the target_detach below + doesn't unpush the target. */ + +- child_inf = add_inferior (child_pid); ++ child_inf = add_inferior (ptid_get_pid (child_ptid)); + + parent_inf = current_inferior (); + child_inf->attach_flag = parent_inf->attach_flag; +@@ -596,8 +591,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + target_terminal_ours_for_output (); + fprintf_filtered (gdb_stdlog, + _("Detaching after fork from " +- "child process %d.\n"), +- child_pid); ++ "child %s.\n"), ++ target_pid_to_str (child_ptid)); + } + + target_detach (NULL, 0); +@@ -609,7 +604,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + this new thread, before cloning the program space, and + informing the solib layer about this new process. */ + +- inferior_ptid = ptid_build (child_pid, child_pid, 0); ++ inferior_ptid = child_ptid; + add_thread (inferior_ptid); + + /* If this is a vfork child, then the address-space is shared +diff --git gdb/linux-nat.c gdb/linux-nat.c +index cb10e2c..57bd1e7 100644 +--- gdb/linux-nat.c ++++ gdb/linux-nat.c +@@ -387,20 +387,19 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child, + int status = W_STOPCODE (0); + struct cleanup *old_chain; + int has_vforked; ++ ptid_t parent_ptid, child_ptid; + int parent_pid, child_pid; + + has_vforked = (inferior_thread ()->pending_follow.kind + == TARGET_WAITKIND_VFORKED); +- parent_pid = ptid_get_lwp (inferior_ptid); +- if (parent_pid == 0) +- parent_pid = ptid_get_pid (inferior_ptid); +- child_pid +- = ptid_get_pid (inferior_thread ()->pending_follow.value.related_pid); +- ++ parent_ptid = inferior_ptid; ++ child_ptid = inferior_thread ()->pending_follow.value.related_pid; ++ parent_pid = ptid_get_lwp (parent_ptid); ++ child_pid = ptid_get_lwp (child_ptid); + + /* We're already attached to the parent, by default. */ + old_chain = save_inferior_ptid (); +- inferior_ptid = ptid_build (child_pid, child_pid, 0); ++ inferior_ptid = child_ptid; + child_lp = add_lwp (inferior_ptid); + child_lp->stopped = 1; + child_lp->last_resume_kind = resume_stop; +@@ -457,7 +456,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child, + { + struct lwp_info *parent_lp; + +- parent_lp = find_lwp_pid (pid_to_ptid (parent_pid)); ++ parent_lp = find_lwp_pid (parent_ptid); + gdb_assert (linux_supports_tracefork () >= 0); + + if (linux_supports_tracevforkdone ()) Index: devel/gdb/files/commit-8f60fe0 =================================================================== --- /dev/null +++ devel/gdb/files/commit-8f60fe0 @@ -0,0 +1,127 @@ +diff --git gdb/amd64fbsd-nat.c gdb/amd64fbsd-nat.c +index a721f48..4745b44 100644 +--- gdb/amd64fbsd-nat.c ++++ gdb/amd64fbsd-nat.c +@@ -227,9 +227,7 @@ _initialize_amd64fbsd_nat (void) + t->to_mourn_inferior = amd64fbsd_mourn_inferior; + t->to_read_description = amd64fbsd_read_description; + +- t->to_pid_to_exec_file = fbsd_pid_to_exec_file; +- t->to_find_memory_regions = fbsd_find_memory_regions; +- add_target (t); ++ fbsd_nat_add_target (t); + + /* Support debugging kernel virtual memory images. */ + bsd_kvm_add_target (amd64fbsd_supply_pcb); +diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c +index 1ce197d..68b8e65 100644 +--- gdb/fbsd-nat.c ++++ gdb/fbsd-nat.c +@@ -37,7 +37,7 @@ + /* Return the name of a file that can be opened to get the symbols for + the child process identified by PID. */ + +-char * ++static char * + fbsd_pid_to_exec_file (struct target_ops *self, int pid) + { + ssize_t len = PATH_MAX; +@@ -71,7 +71,7 @@ fbsd_pid_to_exec_file (struct target_ops *self, int pid) + calling FUNC for each memory region. OBFD is passed as the last + argument to FUNC. */ + +-int ++static int + fbsd_find_memory_regions (struct target_ops *self, + find_memory_region_ftype func, void *obfd) + { +@@ -149,7 +149,7 @@ fbsd_read_mapping (FILE *mapfile, unsigned long *start, unsigned long *end, + calling FUNC for each memory region. OBFD is passed as the last + argument to FUNC. */ + +-int ++static int + fbsd_find_memory_regions (struct target_ops *self, + find_memory_region_ftype func, void *obfd) + { +@@ -200,3 +200,11 @@ fbsd_find_memory_regions (struct target_ops *self, + return 0; + } + #endif ++ ++void ++fbsd_nat_add_target (struct target_ops *t) ++{ ++ t->to_pid_to_exec_file = fbsd_pid_to_exec_file; ++ t->to_find_memory_regions = fbsd_find_memory_regions; ++ add_target (t); ++} +diff --git gdb/fbsd-nat.h gdb/fbsd-nat.h +index e6e88ff..03f6bb1 100644 +--- gdb/fbsd-nat.h ++++ gdb/fbsd-nat.h +@@ -20,16 +20,8 @@ + #ifndef FBSD_NAT_H + #define FBSD_NAT_H + +-/* Return the name of a file that can be opened to get the symbols for +- the child process identified by PID. */ +- +-extern char *fbsd_pid_to_exec_file (struct target_ops *self, int pid); +- +-/* Iterate over all the memory regions in the current inferior, +- calling FUNC for each memory region. OBFD is passed as the last +- argument to FUNC. */ +- +-extern int fbsd_find_memory_regions (struct target_ops *self, +- find_memory_region_ftype func, void *obfd); ++/* Register the customized FreeBSD target. This should be used ++ instead of calling add_target directly. */ ++extern void fbsd_nat_add_target (struct target_ops *); + + #endif /* fbsd-nat.h */ +diff --git gdb/i386fbsd-nat.c gdb/i386fbsd-nat.c +index 6c43f2c..f5d2ee3 100644 +--- gdb/i386fbsd-nat.c ++++ gdb/i386fbsd-nat.c +@@ -176,9 +176,7 @@ _initialize_i386fbsd_nat (void) + #endif + + t->to_resume = i386fbsd_resume; +- t->to_pid_to_exec_file = fbsd_pid_to_exec_file; +- t->to_find_memory_regions = fbsd_find_memory_regions; +- add_target (t); ++ fbsd_nat_add_target (t); + + /* Support debugging kernel virtual memory images. */ + bsd_kvm_add_target (i386fbsd_supply_pcb); +diff --git gdb/ppcfbsd-nat.c gdb/ppcfbsd-nat.c +index 778b4bb..778e19a 100644 +--- gdb/ppcfbsd-nat.c ++++ gdb/ppcfbsd-nat.c +@@ -212,9 +212,7 @@ _initialize_ppcfbsd_nat (void) + t = inf_ptrace_target (); + t->to_fetch_registers = ppcfbsd_fetch_inferior_registers; + t->to_store_registers = ppcfbsd_store_inferior_registers; +- t->to_pid_to_exec_file = fbsd_pid_to_exec_file; +- t->to_find_memory_regions = fbsd_find_memory_regions; +- add_target (t); ++ fbsd_nat_add_target (t); + + /* Support debugging kernel virtual memory images. */ + bsd_kvm_add_target (ppcfbsd_supply_pcb); +diff --git gdb/sparc64fbsd-nat.c gdb/sparc64fbsd-nat.c +index 1a2397f..f197f74 100644 +--- gdb/sparc64fbsd-nat.c ++++ gdb/sparc64fbsd-nat.c +@@ -70,9 +70,7 @@ _initialize_sparc64fbsd_nat (void) + + /* Add some extra features to the generic SPARC target. */ + t = sparc_target (); +- t->to_pid_to_exec_file = fbsd_pid_to_exec_file; +- t->to_find_memory_regions = fbsd_find_memory_regions; +- add_target (t); ++ fbsd_nat_add_target (t); + + sparc_gregmap = &sparc64fbsd_gregmap; + Index: devel/gdb/files/commit-cea6e4f =================================================================== --- /dev/null +++ devel/gdb/files/commit-cea6e4f @@ -0,0 +1,17 @@ +diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c +index 066e288..9705d45 100644 +--- gdb/fbsd-nat.c ++++ gdb/fbsd-nat.c +@@ -23,11 +23,11 @@ + #include "regcache.h" + #include "regset.h" + #include "gdbthread.h" ++#include "gdb_wait.h" + #include + #include + #include + #include +-#include + #ifdef HAVE_KINFO_GETVMMAP + #include + #include Index: devel/gdb/files/commit-d2b41ca =================================================================== --- /dev/null +++ devel/gdb/files/commit-d2b41ca @@ -0,0 +1,56 @@ +diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c +index 214f411..066e288 100644 +--- gdb/fbsd-nat.c ++++ gdb/fbsd-nat.c +@@ -376,6 +376,16 @@ fbsd_wait (struct target_ops *ops, + continue; + } + #endif ++ ++#ifdef PL_FLAG_EXEC ++ if (pl.pl_flags & PL_FLAG_EXEC) ++ { ++ ourstatus->kind = TARGET_WAITKIND_EXECD; ++ ourstatus->value.execd_pathname ++ = xstrdup (fbsd_pid_to_exec_file (NULL, pid)); ++ return wptid; ++ } ++#endif + } + return wptid; + } +@@ -458,6 +468,23 @@ fbsd_post_attach (struct target_ops *self, int pid) + fbsd_enable_follow_fork (pid); + } + #endif ++ ++#ifdef PL_FLAG_EXEC ++/* If the FreeBSD kernel supports PL_FLAG_EXEC, then traced processes ++ will always stop after exec. */ ++ ++static int ++fbsd_insert_exec_catchpoint (struct target_ops *self, int pid) ++{ ++ return 0; ++} ++ ++static int ++fbsd_remove_exec_catchpoint (struct target_ops *self, int pid) ++{ ++ return 0; ++} ++#endif + #endif + + void +@@ -477,6 +504,10 @@ fbsd_nat_add_target (struct target_ops *t) + t->to_post_startup_inferior = fbsd_post_startup_inferior; + t->to_post_attach = fbsd_post_attach; + #endif ++#ifdef PL_FLAG_EXEC ++ t->to_insert_exec_catchpoint = fbsd_insert_exec_catchpoint; ++ t->to_remove_exec_catchpoint = fbsd_remove_exec_catchpoint; ++#endif + #endif + add_target (t); + } Index: devel/gdb/files/commit-e58e05d =================================================================== --- /dev/null +++ devel/gdb/files/commit-e58e05d @@ -0,0 +1,295 @@ +diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c +index 68b8e65..214f411 100644 +--- gdb/fbsd-nat.c ++++ gdb/fbsd-nat.c +@@ -25,7 +25,9 @@ + #include "gdbthread.h" + #include + #include ++#include + #include ++#include + #ifdef HAVE_KINFO_GETVMMAP + #include + #include +@@ -201,10 +203,280 @@ fbsd_find_memory_regions (struct target_ops *self, + } + #endif + ++#ifdef PT_LWPINFO ++static ptid_t (*super_wait) (struct target_ops *, ++ ptid_t, ++ struct target_waitstatus *, ++ int); ++ ++#ifdef TDP_RFPPWAIT ++/* ++ To catch fork events, PT_FOLLOW_FORK is set on every traced process ++ to enable stops on returns from fork or vfork. Note that both the ++ parent and child will always stop, even if system call stops are not ++ enabled. ++ ++ After a fork, both the child and parent process will stop and report ++ an event. However, there is no guarantee of order. If the parent ++ reports its stop first, then fbsd_wait explicitly waits for the new ++ child before returning. If the child reports its stop first, then ++ the event is saved on a list and ignored until the parent's stop is ++ reported. fbsd_wait could have been changed to fetch the parent PID ++ of the new child and used that to wait for the parent explicitly. ++ However, if two threads in the parent fork at the same time, then ++ the wait on the parent might return the "wrong" fork event. ++ ++ The initial version of PT_FOLLOW_FORK did not set PL_FLAG_CHILD for ++ the new child process. This flag could be inferred by treating any ++ events for an unknown pid as a new child. ++ ++ In addition, the initial version of PT_FOLLOW_FORK did not report a ++ stop event for the parent process of a vfork until after the child ++ process executed a new program or exited. The kernel was changed to ++ defer the wait for exit or exec of the child until after posting the ++ stop event shortly after the change to introduce PL_FLAG_CHILD. ++ This could be worked around by reporting a vfork event when the ++ child event posted and ignoring the subsequent event from the ++ parent. ++ ++ This implementation requires both of these fixes for simplicity's ++ sake. FreeBSD versions newer than 9.1 contain both fixes. ++*/ ++ ++struct fbsd_fork_child_info ++{ ++ struct fbsd_fork_child_info *next; ++ pid_t child; /* Pid of new child. */ ++}; ++ ++static struct fbsd_fork_child_info *fbsd_pending_children; ++ ++/* Record a new child process event that is reported before the ++ corresponding fork event in the parent. */ ++ ++static void ++fbsd_remember_child (pid_t pid) ++{ ++ struct fbsd_fork_child_info *info; ++ ++ info = xcalloc (1, sizeof *info); ++ ++ info->child = pid; ++ info->next = fbsd_pending_children; ++ fbsd_pending_children = info; ++} ++ ++/* Check for a previously-recorded new child process event for PID. ++ If one is found, remove it from the list. */ ++ ++static int ++fbsd_is_child_pending (pid_t pid) ++{ ++ struct fbsd_fork_child_info *info, *prev; ++ ++ prev = NULL; ++ for (info = fbsd_pending_children; info; prev = info, info = info->next) ++ { ++ if (info->child == pid) ++ { ++ if (prev == NULL) ++ fbsd_pending_children = info->next; ++ else ++ prev->next = info->next; ++ xfree (info); ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++/* Fetch the external variant of the kernel's internal process ++ structure for the process PID into KP. */ ++ ++static void ++fbsd_fetch_kinfo_proc (pid_t pid, struct kinfo_proc *kp) ++{ ++ size_t len; ++ int mib[4]; ++ ++ len = sizeof *kp; ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PROC; ++ mib[2] = KERN_PROC_PID; ++ mib[3] = pid; ++ if (sysctl (mib, 4, kp, &len, NULL, 0) == -1) ++ perror_with_name (("sysctl")); ++} ++#endif ++ ++/* Wait for the child specified by PTID to do something. Return the ++ process ID of the child, or MINUS_ONE_PTID in case of error; store ++ the status in *OURSTATUS. */ ++ ++static ptid_t ++fbsd_wait (struct target_ops *ops, ++ ptid_t ptid, struct target_waitstatus *ourstatus, ++ int target_options) ++{ ++ ptid_t wptid; ++ ++ while (1) ++ { ++ wptid = super_wait (ops, ptid, ourstatus, target_options); ++ if (ourstatus->kind == TARGET_WAITKIND_STOPPED) ++ { ++ struct ptrace_lwpinfo pl; ++ pid_t pid; ++ int status; ++ ++ pid = ptid_get_pid (wptid); ++ if (ptrace (PT_LWPINFO, pid, (caddr_t)&pl, sizeof pl) == -1) ++ perror_with_name (("ptrace")); ++ ++#ifdef TDP_RFPPWAIT ++ if (pl.pl_flags & PL_FLAG_FORKED) ++ { ++ struct kinfo_proc kp; ++ pid_t child; ++ ++ child = pl.pl_child_pid; ++ ourstatus->kind = TARGET_WAITKIND_FORKED; ++ ourstatus->value.related_pid = pid_to_ptid (child); ++ ++ /* Make sure the other end of the fork is stopped too. */ ++ if (!fbsd_is_child_pending (child)) ++ { ++ pid = waitpid (child, &status, 0); ++ if (pid == -1) ++ perror_with_name (("waitpid")); ++ ++ gdb_assert (pid == child); ++ ++ if (ptrace (PT_LWPINFO, child, (caddr_t)&pl, sizeof pl) == -1) ++ perror_with_name (("ptrace")); ++ ++ gdb_assert (pl.pl_flags & PL_FLAG_CHILD); ++ } ++ ++ /* For vfork, the child process will have the P_PPWAIT ++ flag set. */ ++ fbsd_fetch_kinfo_proc (child, &kp); ++ if (kp.ki_flag & P_PPWAIT) ++ ourstatus->kind = TARGET_WAITKIND_VFORKED; ++ ++ return wptid; ++ } ++ ++ if (pl.pl_flags & PL_FLAG_CHILD) ++ { ++ /* Remember that this child forked, but do not report it ++ until the parent reports its corresponding fork ++ event. */ ++ fbsd_remember_child (ptid_get_pid (wptid)); ++ continue; ++ } ++#endif ++ } ++ return wptid; ++ } ++} ++ ++#ifdef TDP_RFPPWAIT ++/* Target hook for follow_fork. On entry and at return inferior_ptid is ++ the ptid of the followed inferior. */ ++ ++static int ++fbsd_follow_fork (struct target_ops *ops, int follow_child, ++ int detach_fork) ++{ ++ if (!follow_child) ++ { ++ struct thread_info *tp = inferior_thread (); ++ pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid); ++ ++ /* Breakpoints have already been detached from the child by ++ infrun.c. */ ++ ++ if (ptrace (PT_DETACH, child_pid, (PTRACE_TYPE_ARG3)1, 0) == -1) ++ perror_with_name (("ptrace")); ++ } ++ ++ return 0; ++} ++ ++static int ++fbsd_insert_fork_catchpoint (struct target_ops *self, int pid) ++{ ++ return 0; ++} ++ ++static int ++fbsd_remove_fork_catchpoint (struct target_ops *self, int pid) ++{ ++ return 0; ++} ++ ++static int ++fbsd_insert_vfork_catchpoint (struct target_ops *self, int pid) ++{ ++ return 0; ++} ++ ++static int ++fbsd_remove_vfork_catchpoint (struct target_ops *self, int pid) ++{ ++ return 0; ++} ++ ++/* Enable fork tracing for a specific process. ++ ++ To catch fork events, PT_FOLLOW_FORK is set on every traced process ++ to enable stops on returns from fork or vfork. Note that both the ++ parent and child will always stop, even if system call stops are ++ not enabled. */ ++ ++static void ++fbsd_enable_follow_fork (pid_t pid) ++{ ++ if (ptrace (PT_FOLLOW_FORK, pid, (PTRACE_TYPE_ARG3)0, 1) == -1) ++ perror_with_name (("ptrace")); ++} ++ ++/* Implement the "to_post_startup_inferior" target_ops method. */ ++ ++static void ++fbsd_post_startup_inferior (struct target_ops *self, ptid_t pid) ++{ ++ fbsd_enable_follow_fork (ptid_get_pid (pid)); ++} ++ ++/* Implement the "to_post_attach" target_ops method. */ ++ ++static void ++fbsd_post_attach (struct target_ops *self, int pid) ++{ ++ fbsd_enable_follow_fork (pid); ++} ++#endif ++#endif ++ + void + fbsd_nat_add_target (struct target_ops *t) + { + t->to_pid_to_exec_file = fbsd_pid_to_exec_file; + t->to_find_memory_regions = fbsd_find_memory_regions; ++#ifdef PT_LWPINFO ++ super_wait = t->to_wait; ++ t->to_wait = fbsd_wait; ++#ifdef TDP_RFPPWAIT ++ t->to_follow_fork = fbsd_follow_fork; ++ t->to_insert_fork_catchpoint = fbsd_insert_fork_catchpoint; ++ t->to_remove_fork_catchpoint = fbsd_remove_fork_catchpoint; ++ t->to_insert_vfork_catchpoint = fbsd_insert_vfork_catchpoint; ++ t->to_remove_vfork_catchpoint = fbsd_remove_vfork_catchpoint; ++ t->to_post_startup_inferior = fbsd_post_startup_inferior; ++ t->to_post_attach = fbsd_post_attach; ++#endif ++#endif + add_target (t); + } Index: devel/gdb/files/patch-gdb-i386fbsd-nat.c =================================================================== --- devel/gdb/files/patch-gdb-i386fbsd-nat.c +++ devel/gdb/files/patch-gdb-i386fbsd-nat.c @@ -1,5 +1,5 @@ diff --git gdb/i386fbsd-nat.c gdb/i386fbsd-nat.c -index 6c43f2c..a205a26 100644 +index f5d2ee3..7a36302 100644 --- gdb/i386fbsd-nat.c +++ gdb/i386fbsd-nat.c @@ -175,7 +175,6 @@ _initialize_i386fbsd_nat (void) @@ -7,6 +7,6 @@ #endif - t->to_resume = i386fbsd_resume; - t->to_pid_to_exec_file = fbsd_pid_to_exec_file; - t->to_find_memory_regions = fbsd_find_memory_regions; - add_target (t); + fbsd_nat_add_target (t); + + /* Support debugging kernel virtual memory images. */