diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-06-28 23:04:32 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-06-28 23:04:32 +0000 |
commit | 74cf13956febb1f6c8e0f5d5f48814953d41dd28 (patch) | |
tree | f06240a34afca06791450a91c8aac297abda27df /gdb/testsuite/gdb.base/execd-prog.c | |
parent | 9cd2c67bacb9aaa7e82457e68e1a6087c8bde928 (diff) | |
download | gdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.zip gdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.tar.gz gdb-74cf13956febb1f6c8e0f5d5f48814953d41dd28.tar.bz2 |
import gdb-1999-06-28 snapshot
Diffstat (limited to 'gdb/testsuite/gdb.base/execd-prog.c')
-rw-r--r-- | gdb/testsuite/gdb.base/execd-prog.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/execd-prog.c b/gdb/testsuite/gdb.base/execd-prog.c new file mode 100644 index 0000000..5469f65 --- /dev/null +++ b/gdb/testsuite/gdb.base/execd-prog.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +/* There is a global_i in foll-exec, which exec's us. We + should not be able to see that other definition of global_i + after we are exec'd. + */ +int global_i = 0; + +#ifdef PROTOTYPES +int main (int argc, char **argv) +#else +main (argc, argv) + int argc; + char * argv[]; +#endif +{ + /* There is a local_j in foll-exec, which exec's us. We + should not be able to see that other definition of local_j + after we are exec'd. + */ + int local_j = argc; + char * s; + + printf ("Hello from execd-prog...\n"); + if (argc != 2) + { + printf ("expected one string argument\n"); + exit (-1); + } + s = argv[1]; + printf ("argument received: %s\n", s); +} |