diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2014-10-24 11:04:56 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-11-13 10:20:38 +0100 |
commit | 58fa2af0b3d87dbc2aaf640ef31af301e5f3c9b6 (patch) | |
tree | 7c87f9d39281eb6ead281a9e8dfeb9da29311eaf /gdb/testsuite | |
parent | 04e5059ba62bf70b1b73f525d306e05fad66131a (diff) | |
download | gdb-58fa2af0b3d87dbc2aaf640ef31af301e5f3c9b6.zip gdb-58fa2af0b3d87dbc2aaf640ef31af301e5f3c9b6.tar.gz gdb-58fa2af0b3d87dbc2aaf640ef31af301e5f3c9b6.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/execd-prog.c | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/foll-exec.c | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/foll-exec.exp | 37 |
4 files changed, 30 insertions, 20 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 148a44c..c4021c0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com> + * 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 Andreas Arnez <arnez@linux.vnet.ibm.com> + * gdb.base/ending-run.c: Add eye-catchers. * gdb.base/ending-run.exp: Refer to eye-catchers instead of literal line numbers. diff --git a/gdb/testsuite/gdb.base/execd-prog.c b/gdb/testsuite/gdb.base/execd-prog.c index 5469f65..5435f7d 100644 --- a/gdb/testsuite/gdb.base/execd-prog.c +++ b/gdb/testsuite/gdb.base/execd-prog.c @@ -20,7 +20,7 @@ main (argc, argv) should not be able to see that other definition of local_j after we are exec'd. */ - int local_j = argc; + int local_j = argc; /* after-exec */ char * s; printf ("Hello from execd-prog...\n"); diff --git a/gdb/testsuite/gdb.base/foll-exec.c b/gdb/testsuite/gdb.base/foll-exec.c index 78c1cda..5b0d9c5 100644 --- a/gdb/testsuite/gdb.base/foll-exec.c +++ b/gdb/testsuite/gdb.base/foll-exec.c @@ -24,7 +24,7 @@ main () printf ("foll-exec is about to execl(execd-prog)...\n"); - execl (BASEDIR "/execd-prog", + execl (BASEDIR "/execd-prog", /* tbreak-execl */ BASEDIR "/execd-prog", "execl arg1 from foll-exec", "execl arg2 from foll-exec", @@ -38,6 +38,6 @@ main () printf ("foll-exec is about to execv(execd-prog)...\n"); - execv (BASEDIR "/execd-prog", argv); + execv (BASEDIR "/execd-prog", argv); /* tbreak-execv */ } } diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp index c1b1354..810fd70 100644 --- a/gdb/testsuite/gdb.base/foll-exec.exp +++ b/gdb/testsuite/gdb.base/foll-exec.exp @@ -119,7 +119,7 @@ proc do_exec_tests {} { # send_gdb "next 3\n" gdb_expect { - -re "20.*execlp.*$gdb_prompt $"\ + -re "execlp \\(.*$gdb_prompt $"\ {pass "step to exec call"} -re "$gdb_prompt $" {fail "step to exec call"} timeout {fail "(timeout) step to exec call"} @@ -149,9 +149,10 @@ proc do_exec_tests {} { # Try stepping through an execlp call, without catching it. # We should stop in execd-program, at its first statement. # + set execd_line [gdb_get_line_number "after-exec" $srcfile2] send_gdb "next\n" gdb_expect { - -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\ + -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\ {pass "step through execlp call"} -re "$gdb_prompt $" {fail "step through execlp call"} timeout {fail "(timeout) step through execlp call"} @@ -162,7 +163,7 @@ proc do_exec_tests {} { # send_gdb "next\n" gdb_expect { - -re "26.*printf.*$gdb_prompt $"\ + -re "printf \\(.Hello .*$gdb_prompt $"\ {pass "step after execlp call"} -re "$gdb_prompt $" {fail "step after execlp call"} timeout {fail "(timeout) step after execlp call"} @@ -256,7 +257,7 @@ proc do_exec_tests {} { # send_gdb "continue\n" gdb_expect { - -re ".*${srcfile2}:23.*$gdb_prompt $"\ + -re ".*${srcfile2}:${execd_line}.*$gdb_prompt $"\ {pass "continue after hit catch exec"} -re "$gdb_prompt $" {fail "continue after hit catch exec"} timeout {fail "(timeout) continue after hit catch exec"} @@ -276,16 +277,17 @@ proc do_exec_tests {} { # Verify that we can follow through follow an execl() # call. (We must jump around earlier exec* calls.) # - send_gdb "tbreak 27\n" + set tbreak_line [gdb_get_line_number "tbreak-execl" $srcfile] + send_gdb "tbreak ${tbreak_line}\n" gdb_expect { - -re "Temporary breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\ + -re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\ {pass "prepare to jump to execl call"} -re "$gdb_prompt $" {fail "prepare to jump to execl call"} timeout {fail "(timeout) prepare to jump to execl call"} } - send_gdb "jump 27\n" + send_gdb "jump ${tbreak_line}\n" gdb_expect { - -re "main.* at .*${srcfile}:27.*$gdb_prompt $"\ + -re "main.* at .*${srcfile}:${tbreak_line}.*$gdb_prompt $"\ {pass "jump to execl call"} -re "$gdb_prompt $" {fail "jump to execl call"} timeout {fail "(timeout) jump to execl call"} @@ -298,14 +300,14 @@ proc do_exec_tests {} { # send_gdb "next 2\n" gdb_expect { - -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\ + -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\ {pass "step through execl call"} -re "$gdb_prompt $" {fail "step through execl call"} timeout {fail "(timeout) step through execl call"} } send_gdb "next\n" gdb_expect { - -re "26.*printf.*$gdb_prompt $"\ + -re "printf \\(.Hello .*$gdb_prompt $"\ {pass "step after execl call"} -re "$gdb_prompt $" {fail "step after execl call"} timeout {fail "(timeout) step after execl call"} @@ -336,30 +338,31 @@ proc do_exec_tests {} { # Verify that we can follow through follow an execv() # call. (We must jump around earlier exec* calls.) # - send_gdb "tbreak 41\n" + set tbreak_line [gdb_get_line_number "tbreak-execv"] + send_gdb "tbreak ${tbreak_line}\n" gdb_expect { - -re "Temporary breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\ + -re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\ {pass "prepare to jump to execv call"} -re "$gdb_prompt $" {fail "prepare to jump to execv call"} timeout {fail "(timeout) prepare to jump to execv call"} } - send_gdb "jump 41\n" + send_gdb "jump ${tbreak_line}\n" gdb_expect { - -re "main.* at .*${srcfile}:41.*$gdb_prompt $"\ + -re "main.* at .*${srcfile}:${tbreak_line}.*$gdb_prompt $"\ {pass "jump to execv call"} -re "$gdb_prompt $" {fail "jump to execv call"} timeout {fail "(timeout) jump to execv call"} } send_gdb "next\n" gdb_expect { - -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\ + -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\ {pass "step through execv call"} -re "$gdb_prompt $" {fail "step through execv call"} timeout {fail "(timeout) step through execv call"} } send_gdb "next\n" gdb_expect { - -re "26.*printf.*$gdb_prompt $"\ + -re "printf \\(.Hello .*$gdb_prompt $"\ {pass "step after execv call"} -re "$gdb_prompt $" {fail "step after execv call"} timeout {fail "(timeout) step after execv call"} @@ -393,7 +396,7 @@ proc do_exec_tests {} { # send_gdb "continue\n" gdb_expect { - -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\ + -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int local_j = argc;.*$gdb_prompt $"\ {pass "continue through exec"} -re "$gdb_prompt $" {fail "continue through exec"} timeout {fail "(timeout) continue through exec"} |