binutils-gdb/gdb/testsuite/gdb.base/execd-prog.c
Andreas Arnez 58fa2af0b3 Eliminate literal line numbers in foll-exec.exp
Remove literal line numbers from the regexps in foll-exec.exp.  Add
appropriate eye-catchers to foll-exec.c and execd-proc.c and refer to
those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/execd-prog.c: Add eye-catchers.
	* gdb.base/foll-exec.c: Likewise.
	* gdb.base/foll-exec.exp: Refer to eye-catchers instead of literal
	line numbers.
2014-11-13 10:20:38 +01:00

34 lines
752 B
C

#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; /* after-exec */
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);
}