aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
committerStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
commit7a292a7adf506b866905b06b3024c0fd411c4583 (patch)
tree5b208bb48269b8a82d5c3a5f19c87b45a62a22f4 /gdb/procfs.c
parent1996fae84682e8ddd146215dd2959ad1ec924c09 (diff)
downloadgdb-7a292a7adf506b866905b06b3024c0fd411c4583.zip
gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.gz
gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.bz2
import gdb-19990422 snapshot
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index ff20240..6822f42 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -582,6 +582,10 @@ static int open_proc_file PARAMS ((int, struct procinfo *, int, int));
static void close_proc_file PARAMS ((struct procinfo *));
+static void close_proc_file_cleanup PARAMS ((void*));
+
+static struct cleanup *make_cleanup_close_proc_file PARAMS ((struct procinfo *));
+
static void unconditionally_kill_inferior PARAMS ((struct procinfo *));
static NORETURN void proc_init_failed PARAMS ((struct procinfo *, char *, int)) ATTR_NORETURN;
@@ -4024,6 +4028,20 @@ close_proc_file (pip)
}
}
+static void
+close_proc_file_cleanup (pip)
+ void *pip;
+{
+ close_proc_file ((struct procinfo *) pip);
+}
+
+static struct cleanup *
+make_cleanup_close_proc_file (pip)
+ struct procinfo *pip;
+{
+ return make_cleanup (close_proc_file_cleanup, pip);
+}
+
/*
LOCAL FUNCTION
@@ -4760,7 +4778,7 @@ info_proc (args, from_tty)
{
nomem (0);
}
- make_cleanup (freeargv, (char *) argv);
+ make_cleanup_freeargv (argv);
while (*argv != NULL)
{
@@ -4822,7 +4840,7 @@ info_proc (args, from_tty)
/* NOTREACHED */
}
pid = pip->pid;
- make_cleanup (close_proc_file, pip);
+ make_cleanup_close_proc_file (pip);
}
else if (**argv != '\000')
{
@@ -4874,7 +4892,7 @@ No process. Start debugging a program or specify an explicit process ID.");
if (!open_proc_file ((*lwps << 16) | pid, pip, O_RDONLY, 0))
continue;
- make_cleanup (close_proc_file, pip);
+ make_cleanup_close_proc_file (pip);
if (!procfs_read_status (pip))
{