From dd21d8b5880693d9b85b1254773dc71c2c06a002 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 2 Dec 2005 03:19:17 +0000 Subject: 2005-12-01 Michael Snyder * linux-fork.c (fork_save_infrun_state): Close the DIR. (info_forks_command): Print bare filename, not full path. * linux-nat.c (kill_inferior): For multi-fork, pop target and call generic_mourn_inferior, not target_mourn_inferior. --- gdb/ChangeLog | 7 +++++++ gdb/linux-fork.c | 11 ++++++++++- gdb/linux-nat.c | 5 +++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b60a5df..a498e50 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2005-12-01 Michael Snyder + + * linux-fork.c (fork_save_infrun_state): Close the DIR. + (info_forks_command): Print bare filename, not full path. + * linux-nat.c (kill_inferior): For multi-fork, pop target + and call generic_mourn_inferior, not target_mourn_inferior. + 2005-11-30 Michael Snyder * linux-fork.c (struct fork_info): Add fields for saving diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index a922b56..ba83923 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -24,6 +24,7 @@ #include "regcache.h" /* For regcache copy/restore */ #include "gdbcmd.h" #include "infcall.h" /* For call_function_by_hand */ +#include "gdb_string.h" #include "linux-fork.h" /* External interface */ @@ -294,6 +295,7 @@ fork_save_infrun_state (struct fork_info *fp, int clobber_regs) tmp = strtol (&de->d_name[0], NULL, 10); fp->filepos[tmp] = call_lseek (tmp, 0, SEEK_CUR); } + closedir (d); } } } @@ -422,7 +424,14 @@ info_forks_command (char *arg, int from_tty) sal = find_pc_line (pc, 0); if (sal.symtab) - printf_filtered (", file %s", sal.symtab->filename); + { + char *tmp = strrchr (sal.symtab->filename, '/'); + + if (tmp) + printf_filtered (", file %s", tmp + 1); + else + printf_filtered (", file %s", sal.symtab->filename); + } if (sal.line) printf_filtered (", line %d", sal.line); if (!sal.symtab && !sal.line) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 74a48f1..9b01021 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -620,6 +620,8 @@ kill_inferior (void) if (FORKS_EXIST ()) { linux_fork_killall (); + pop_target (); + generic_mourn_inferior (); } else { @@ -648,9 +650,8 @@ kill_inferior (void) ptrace (PT_KILL, pid, 0, 0); ret = wait (&status); } + target_mourn_inferior (); } - - target_mourn_inferior (); } /* On GNU/Linux there are no real LWP's. The closest thing to LWP's -- cgit v1.1