diff options
-rw-r--r-- | usr.bin/pmdb/pmdb.1 | 7 | ||||
-rw-r--r-- | usr.bin/pmdb/pmdb.c | 3 | ||||
-rw-r--r-- | usr.bin/pmdb/pmdb.h | 3 | ||||
-rw-r--r-- | usr.bin/pmdb/process.c | 11 |
4 files changed, 20 insertions, 4 deletions
diff --git a/usr.bin/pmdb/pmdb.1 b/usr.bin/pmdb/pmdb.1 index 9eb768b8e71..3836e635502 100644 --- a/usr.bin/pmdb/pmdb.1 +++ b/usr.bin/pmdb/pmdb.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pmdb.1,v 1.8 2002/06/09 02:44:34 todd Exp $ +.\" $OpenBSD: pmdb.1,v 1.9 2002/08/08 18:27:57 art Exp $ .\" .\" Copyright (c) 2002 Artur Grabowski <art@openbsd.org> .\" All rights reserved. @@ -105,6 +105,11 @@ Sets the signal state for the specified signal to either ignore it and pass it to the process or to stop the process. .It sigstate Shows which signals are currently ignored. +.It setenv Ar var Ar val +Sets the environment variable +.Ar var +to the value +.Ar val . .It break Ar symname|addr Sets a breakpoint at the symbol .Ar symname diff --git a/usr.bin/pmdb/pmdb.c b/usr.bin/pmdb/pmdb.c index 6bb4d758cbe..b1d74c7030b 100644 --- a/usr.bin/pmdb/pmdb.c +++ b/usr.bin/pmdb/pmdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmdb.c,v 1.11 2002/07/22 23:26:05 fgsch Exp $ */ +/* $OpenBSD: pmdb.c,v 1.12 2002/08/08 18:27:57 art Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -56,6 +56,7 @@ struct clit cmds[] = { { "run", "run process", 0, 0, cmd_process_run, (void *)-1 }, { "continue", "continue process", 0, 0, cmd_process_cont, (void *)-1 }, { "kill", "kill process", 0, 0, cmd_process_kill, (void *)-1 }, + { "setenv", "set env variables", 2, 2, cmd_process_setenv, (void *)-1 }, /* signal handling commands. */ { "signal", "ignore signal", 2, 2, cmd_signal_ignore, (void *)-1 }, diff --git a/usr.bin/pmdb/pmdb.h b/usr.bin/pmdb/pmdb.h index ab406bdd8b6..f1b6446e127 100644 --- a/usr.bin/pmdb/pmdb.h +++ b/usr.bin/pmdb/pmdb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmdb.h,v 1.4 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: pmdb.h,v 1.5 2002/08/08 18:27:57 art Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -95,6 +95,7 @@ int process_getregs(struct pstate *, struct reg *); int cmd_process_run(int, char **, void *); int cmd_process_cont(int, char **, void *); int cmd_process_kill(int, char **, void *); +int cmd_process_setenv(int, char **, void *); /* signal.c */ void init_sigstate(struct pstate *); diff --git a/usr.bin/pmdb/process.c b/usr.bin/pmdb/process.c index a128da74eb5..8e9ce59e16e 100644 --- a/usr.bin/pmdb/process.c +++ b/usr.bin/pmdb/process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process.c,v 1.9 2002/07/31 02:38:39 art Exp $ */ +/* $OpenBSD: process.c,v 1.10 2002/08/08 18:27:57 art Exp $ */ /* * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -256,3 +256,12 @@ cmd_process_cont(int argc, char **argv, void *arg) return (1); } + +int +cmd_process_setenv(int argc, char **argv, void *arg) +{ + if (setenv(argv[1], argv[2], 1)) + err(1, "setenv"); + + return (0); +} |