public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 2/3] Eliminate literal line numbers in mi-until.exp
  2014-11-14 18:47 [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Andreas Arnez
@ 2014-11-14 18:47 ` Andreas Arnez
  2014-11-14 18:47 ` [PATCH 1/3] Drop remaining references to removed source lines in break1.c and ur1.c Andreas Arnez
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Andreas Arnez @ 2014-11-14 18:47 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in mi-until.exp.  Add
appropriate eye-catchers to until.c and refer to those instead.

This change fixes the test case after having disturbed the line
numbering with the previous fix for compiler warnings with -std=gnu11.

gdb/testsuite/ChangeLog:

	* gdb.mi/until.c: Add eye-catchers.
	* gdb.mi/mi-until.exp: Refer to eye-catchers instead of literal
	line numbers.
---
 gdb/testsuite/gdb.mi/mi-until.exp | 23 +++++++++++++++--------
 gdb/testsuite/gdb.mi/until.c      | 10 +++++-----
 2 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp
index 3fabcd2..2d0bc4e 100644
--- a/gdb/testsuite/gdb.mi/mi-until.exp
+++ b/gdb/testsuite/gdb.mi/mi-until.exp
@@ -42,12 +42,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 
 proc test_running_to_foo {} {
-    mi_create_breakpoint "10" \
+    set line [gdb_get_line_number "in-loop"]
+    mi_create_breakpoint $line \
 	"break-insert operation" \
-	-number 1 -func foo -file ".*until.c" -line 10
+	-number 1 -func foo -file ".*until.c" -line $line
 
     mi_run_cmd
-    mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 \
+    mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" $line \
       { "" "disp=\"keep\"" } "run to main"
 
     mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1"
@@ -56,17 +57,23 @@ proc test_running_to_foo {} {
 
 proc test_until {} {
     setup_kfail gdb/2104 "*-*-*"
-    mi_execute_to "exec-until" "end-stepping-range" "foo" "" ".*until.c" "12" "" \
+    set line [gdb_get_line_number "after-loop"]
+    mi_execute_to "exec-until" "end-stepping-range" "foo" "" ".*until.c" $line "" \
         "until after while loop"
 
-    mi_execute_to "exec-until 15" "location-reached" "foo" "" ".*until.c" "15" ""\
+    set line [gdb_get_line_number "until-here"]
+    mi_execute_to "exec-until $line" "location-reached" "foo" "" ".*until.c" $line ""\
         "until line number"
 
-    mi_execute_to "exec-until until.c:17" "location-reached" "foo" "" ".*until.c" "17" ""\
+    set line [gdb_get_line_number "until-there"]
+    mi_execute_to "exec-until until.c:$line" "location-reached" "foo" "" ".*until.c" $line ""\
         "until line number:file"
 
-    # This is supposed to NOT stop at line 25. It stops right after foo is over.
-    mi_execute_to "exec-until until.c:25" "location-reached" "main" "" ".*until.c" "(23|24)" ""\
+    # This is supposed to NOT stop at the return statement, but right
+    # after foo is over.
+    set line [gdb_get_line_number "at-return"]
+    mi_execute_to "exec-until until.c:$line" "location-reached" "main" ""\
+	".*until.c" "([expr $line-2]|[expr $line-1])" ""\
         "until after current function"
 }
 
diff --git a/gdb/testsuite/gdb.mi/until.c b/gdb/testsuite/gdb.mi/until.c
index 21bdeda..83beea0 100644
--- a/gdb/testsuite/gdb.mi/until.c
+++ b/gdb/testsuite/gdb.mi/until.c
@@ -8,14 +8,14 @@ foo (void)
  i = 0;
 
  while (i < 2)
-   i++;
+   i++;				/* in-loop */
 
- x = i;
+ x = i;				/* after-loop */
  y = 2 * x;
  z = x + y;
- y = x + z;
+ y = x + z;			/* until-here */
  x = 9;
- y = 10;
+ y = 10;			/* until-there */
 }
 
 int
@@ -24,5 +24,5 @@ main ()
   int a = 1;
   foo ();
   a += 2;
-  return 0;
+  return 0;			/* at-return */
 }
-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] GDB testsuite: More fixes for warnings with -std=gnu11
  2014-11-14 18:47 [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Andreas Arnez
  2014-11-14 18:47 ` [PATCH 2/3] Eliminate literal line numbers in mi-until.exp Andreas Arnez
  2014-11-14 18:47 ` [PATCH 1/3] Drop remaining references to removed source lines in break1.c and ur1.c Andreas Arnez
@ 2014-11-14 18:47 ` Andreas Arnez
  2014-11-15 19:44 ` [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Doug Evans
  3 siblings, 0 replies; 6+ messages in thread
From: Andreas Arnez @ 2014-11-14 18:47 UTC (permalink / raw)
  To: gdb-patches

Fix some more C compiler warnings for missing function return types
and implicit function declarations in the GDB testsuite.

gdb/testsuite/ChangeLog:

	* gdb.base/bp-permanent.c: Include unistd.h.
	* gdb.python/py-framefilter-mi.c (main): Add return type.
	* gdb.python/py-framefilter.c (main): Likewise.
	* gdb.trace/actions-changed.c (main): Likewise.
---
 gdb/testsuite/gdb.base/bp-permanent.c        | 1 +
 gdb/testsuite/gdb.python/py-framefilter-mi.c | 3 ++-
 gdb/testsuite/gdb.python/py-framefilter.c    | 3 ++-
 gdb/testsuite/gdb.trace/actions-changed.c    | 3 +++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/bp-permanent.c b/gdb/testsuite/gdb.base/bp-permanent.c
index 53b3777..a45a922 100644
--- a/gdb/testsuite/gdb.base/bp-permanent.c
+++ b/gdb/testsuite/gdb.base/bp-permanent.c
@@ -18,6 +18,7 @@
 #include <string.h>
 #ifdef SIGNALS
 #include <signal.h>
+#include <unistd.h>
 #endif
 
 #define NOP asm("nop")
diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.c b/gdb/testsuite/gdb.python/py-framefilter-mi.c
index 242efa1..2955b71 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-mi.c
+++ b/gdb/testsuite/gdb.python/py-framefilter-mi.c
@@ -132,7 +132,8 @@ int func5(int f, int d)
   return i;
 }
 
-main()
+int main()
 {
   func5(3,5);
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.python/py-framefilter.c b/gdb/testsuite/gdb.python/py-framefilter.c
index 80087c2..3102dda 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.c
+++ b/gdb/testsuite/gdb.python/py-framefilter.c
@@ -146,10 +146,11 @@ int func5(int f, int d)
   return i;
 }
 
-main()
+int main()
 {
   int z = 32;
   int y = 44;
   const char *foo1 = "Test";
   func5(3,5);
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.trace/actions-changed.c b/gdb/testsuite/gdb.trace/actions-changed.c
index 602e61a..b9df26b 100644
--- a/gdb/testsuite/gdb.trace/actions-changed.c
+++ b/gdb/testsuite/gdb.trace/actions-changed.c
@@ -42,6 +42,7 @@ subr (int parm)
   return busy;
 }
 
+int
 main()
 {
   subr (1);
@@ -63,4 +64,6 @@ main()
   subr (6);
   subr2 (6);
   end (6);
+
+  return 0;
 }
-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings
@ 2014-11-14 18:47 Andreas Arnez
  2014-11-14 18:47 ` [PATCH 2/3] Eliminate literal line numbers in mi-until.exp Andreas Arnez
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Andreas Arnez @ 2014-11-14 18:47 UTC (permalink / raw)
  To: gdb-patches

It seems that my earlier testsuite cleanup has left some test cases in
a broken state.  The first two patches fix (at least some of) these.
I'm sorry for the breakage and hope that I didn't miss anything else.

The third patch fixes some more compiler warnings I've overlooked
before.

Andreas Arnez (3):
  Drop remaining references to removed source lines in break1.c and
    ur1.c
  Eliminate literal line numbers in mi-until.exp
  GDB testsuite: More fixes for warnings with -std=gnu11

 gdb/testsuite/gdb.base/bp-permanent.c        |  1 +
 gdb/testsuite/gdb.base/condbreak.exp         | 28 ++++++++++++----------------
 gdb/testsuite/gdb.base/ena-dis-br.exp        | 26 +++++++++++---------------
 gdb/testsuite/gdb.base/hbreak2.exp           | 25 ++++++++-----------------
 gdb/testsuite/gdb.mi/mi-until.exp            | 23 +++++++++++++++--------
 gdb/testsuite/gdb.mi/until.c                 | 10 +++++-----
 gdb/testsuite/gdb.python/py-framefilter-mi.c |  3 ++-
 gdb/testsuite/gdb.python/py-framefilter.c    |  3 ++-
 gdb/testsuite/gdb.reverse/until-precsave.exp |  6 +++---
 gdb/testsuite/gdb.reverse/until-reverse.exp  |  6 +++---
 gdb/testsuite/gdb.trace/actions-changed.c    |  3 +++
 11 files changed, 65 insertions(+), 69 deletions(-)

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] Drop remaining references to removed source lines in break1.c and ur1.c
  2014-11-14 18:47 [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Andreas Arnez
  2014-11-14 18:47 ` [PATCH 2/3] Eliminate literal line numbers in mi-until.exp Andreas Arnez
@ 2014-11-14 18:47 ` Andreas Arnez
  2014-11-14 18:47 ` [PATCH 3/3] GDB testsuite: More fixes for warnings with -std=gnu11 Andreas Arnez
  2014-11-15 19:44 ` [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Doug Evans
  3 siblings, 0 replies; 6+ messages in thread
From: Andreas Arnez @ 2014-11-14 18:47 UTC (permalink / raw)
  To: gdb-patches

In some .exp files it was missed to remove the references to
eye-catchers like "set breakpoint 9 here" when the non-prototype
function header variants they belonged to were deleted.  This patch
cleans this up.

gdb/testsuite/ChangeLog:

	* gdb.base/condbreak.exp: Drop references to removed non-prototype
	function header variants in break1.c.
	* gdb.base/ena-dis-br.exp: Likewise.
	* gdb.base/hbreak2.exp: Likewise.
	* gdb.reverse/until-precsave.exp: Drop references to removed
	non-prototype function header variants in ur1.c.
	* gdb.reverse/until-reverse.exp: Likewise.
---
 gdb/testsuite/gdb.base/condbreak.exp         | 28 ++++++++++++----------------
 gdb/testsuite/gdb.base/ena-dis-br.exp        | 26 +++++++++++---------------
 gdb/testsuite/gdb.base/hbreak2.exp           | 25 ++++++++-----------------
 gdb/testsuite/gdb.reverse/until-precsave.exp |  6 +++---
 gdb/testsuite/gdb.reverse/until-reverse.exp  |  6 +++---
 5 files changed, 37 insertions(+), 54 deletions(-)

diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index 123428c..0c26b27 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -38,13 +38,9 @@ clean_restart ${binfile}
 set bp_location1  [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location6  [gdb_get_line_number "set breakpoint 6 here"]
 set bp_location8  [gdb_get_line_number "set breakpoint 8 here" $srcfile2]
-set bp_location9  [gdb_get_line_number "set breakpoint 9 here" $srcfile2]
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile2]
 set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile2]
 set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile2]
-set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile2]
 set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile2]
-set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile2]
 
 #
 # test break at function
@@ -113,15 +109,15 @@ if {$hp_aCC_compiler} {
 gdb_test "info break" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location6.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker1$marker1_proto at .*$srcfile2:($bp_location15|$bp_location16).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker1$marker1_proto at .*$srcfile2:$bp_location15.*
 \[\t \]+stop only if \\(1==1\\).*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
 \[\t \]+stop only if \\(1==1\\).*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2$marker2_proto at .*$srcfile2:($bp_location8|$bp_location9).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2$marker2_proto at .*$srcfile2:$bp_location8.*
 \[\t \]+stop only if \\(a==43\\).*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker3$marker3_proto at .*$srcfile2:($bp_location17|$bp_location18).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker3$marker3_proto at .*$srcfile2:$bp_location17.*
 \[\t \]+stop only if \\(multi_line_if_conditional\\(1,1,1\\)==0\\).*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker4$marker4_proto at .*$srcfile2:($bp_location13|$bp_location14).*" \
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker4$marker4_proto at .*$srcfile2:$bp_location14.*" \
     "breakpoint info"
 
 
@@ -179,10 +175,10 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.
 #
 # Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
 gdb_test_multiple "continue" "run until breakpoint at marker1" {
-    -re  "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile2:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
+    -re  "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile2:$bp_location15.*$bp_location15\[\t \]+.*$gdb_prompt $" {
 	pass "run until breakpoint at marker1"
     }
-    -re  "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile2:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
+    -re  "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile2:$bp_location15.*$bp_location15\[\t \]+.*$gdb_prompt $" {
 	xfail "run until breakpoint at marker1"
     }
 }
@@ -191,10 +187,10 @@ gdb_test_multiple "continue" "run until breakpoint at marker1" {
 # Same issues here as above.
 setup_xfail hppa2.0w-*-* 11512CLLbs
 gdb_test_multiple "continue" "run until breakpoint at marker2" {
-    -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile2:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile2:$bp_location8.*$bp_location8\[\t \]+.*$gdb_prompt $" {
 	pass "run until breakpoint at marker2"
     }
-    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile2:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile2:$bp_location8.*$bp_location8\[\t \]+.*$gdb_prompt $" {
 	xfail "run until breakpoint at marker2"
     }
 }
@@ -228,20 +224,20 @@ gdb_test "break *main if (1==1) ta 999" \
 
 set test "run until breakpoint at marker3"
 gdb_test_multiple "continue" $test {
-    -re "Continuing\\..*Breakpoint \[0-9\]+, marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:$bp_location17.*$bp_location17\[\t \]+.*$gdb_prompt $" {
 	pass $test
     }
-    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:$bp_location17.*$bp_location17\[\t \]+.*$gdb_prompt $" {
 	xfail $test
     }
 }
 
 set test "run until breakpoint at marker4"
 gdb_test_multiple "continue" $test {
-    -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile2:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile2:$bp_location14.*$bp_location14\[\t \]+.*$gdb_prompt $" {
 	pass $test
     }
-    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) at .*$srcfile2:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) at .*$srcfile2:$bp_location14.*$bp_location14\[\t \]+.*$gdb_prompt $" {
 	xfail $test
     }
 }
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index 6f2c469..4b2f5b9 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -29,14 +29,10 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} \
 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
 set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile2]
-set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile2]
 set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile2]
 set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile2]
 set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile2]
-set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile2]
 set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile2]
-set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile2]
 
 if ![runto_main] then { fail "enable/disable break tests suppressed" }
 
@@ -58,7 +54,7 @@ proc break_at { breakpoint where } {
     return $bp
 }
 
-set bp [break_at "marker1" " line ($bp_location15|$bp_location16)"]
+set bp [break_at "marker1" " line $bp_location15"]
 
 gdb_test_no_output "enable $bp" "enable break marker1"
 
@@ -82,7 +78,7 @@ gdb_test_no_output "delete $bp" "delete break marker1"
 
 # Verify that we can set a breakpoint to be self-disabling after the
 # first time it triggers.
-set bp [break_at "marker2" " line ($bp_location8|$bp_location9)"]
+set bp [break_at "marker2" " line $bp_location8"]
 
 gdb_test_no_output "enable once $bp" "enable once break marker2"
 
@@ -117,7 +113,7 @@ if ![runto_main] then {
     fail "enable/disable break tests suppressed"
 }
 
-set bp [break_at "marker3" " line ($bp_location17|$bp_location18)"]
+set bp [break_at "marker3" " line $bp_location17"]
 
 gdb_test_no_output "enable del $bp" "enable del break marker3"
 
@@ -126,7 +122,7 @@ gdb_test "info break $bp" \
     "info auto-deleted break marker2"
 
 gdb_test "continue" \
-    ".*marker3 .*:($bp_location17|$bp_location18).*" \
+    ".*marker3 .*:$bp_location17.*" \
     "continue to auto-deleted break marker3"
 
 gdb_test "info break $bp" \
@@ -136,7 +132,7 @@ gdb_test "info break $bp" \
 # Verify that we can set a breakpoint and manually disable it (we've
 # already proven that disabled bp's don't trigger).
 
-set bp [break_at "marker4" " line ($bp_location14|$bp_location13).*"]
+set bp [break_at "marker4" " line $bp_location14.*"]
 
 gdb_test_no_output "disable $bp" "disable break marker4"
 
@@ -153,7 +149,7 @@ if ![runto_main] then {
 
 set bp [break_at $bp_location7 "line $bp_location7"]
 
-set bp2 [break_at marker1 " line ($bp_location15|$bp_location16)"]
+set bp2 [break_at marker1 " line $bp_location15"]
 
 gdb_test_no_output "enable count 2 $bp" "disable break with count"
 
@@ -166,7 +162,7 @@ gdb_test "continue" \
     "continue from enable count, second time"
 
 gdb_test "continue" \
-    ".*marker1 .*:($bp_location15|$bp_location16).*" \
+    ".*marker1 .*:$bp_location15.*" \
     "continue through enable count, now disabled"
 
 # Verify that we can set a breakpoint with an ignore count N, which
@@ -177,7 +173,7 @@ if ![runto_main] then {
     fail "enable/disable break tests suppressed"
 }
 
-set bp [break_at "marker1" " line ($bp_location15|$bp_location16).*"]
+set bp [break_at "marker1" " line $bp_location15.*"]
 
 # Verify that an ignore of a non-existent breakpoint is gracefully
 # handled.
@@ -232,7 +228,7 @@ if ![runto_main] then {
     fail "enable/disable break tests suppressed"
 }
 
-set bp [break_at marker1 " line ($bp_location15|$bp_location16).*"]
+set bp [break_at marker1 " line $bp_location15.*"]
 
 gdb_test "ignore $bp 1" \
     "Will ignore next crossing of breakpoint \[0-9\]*.*" \
@@ -248,7 +244,7 @@ gdb_continue_to_end "no stop at ignored & auto-deleted break marker1"
 rerun_to_main
 
 gdb_test "continue" \
-    ".*marker1 .*:($bp_location15|$bp_location16).*" \
+    ".*marker1 .*:$bp_location15.*" \
     "continue to ignored & auto-deleted break marker1"
 
 # Verify that a disabled breakpoint's ignore count isn't updated when
@@ -258,7 +254,7 @@ if ![runto_main] then {
     fail "enable/disable break tests suppressed"
 }
 
-set bp [break_at marker1 " line ($bp_location15|$bp_location16)"]
+set bp [break_at marker1 " line $bp_location15"]
 
 gdb_test "ignore $bp 10" \
     "Will ignore next 10 crossings of breakpoint \[0-9\]*.*" \
diff --git a/gdb/testsuite/gdb.base/hbreak2.exp b/gdb/testsuite/gdb.base/hbreak2.exp
index 42049e5..7e77eb9 100644
--- a/gdb/testsuite/gdb.base/hbreak2.exp
+++ b/gdb/testsuite/gdb.base/hbreak2.exp
@@ -96,7 +96,7 @@ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 # board.  So, to be sure, we do a list command.
 #
 gdb_test "list main" \
-    ".*main \\(argc, argv, envp\\).*" \
+    ".*main \\(int argc, char ..argv, char ..envp\\).*" \
     "use `list' to establish default source file"
 gdb_test "hbreak $bp_location1" \
     "Hardware assisted breakpoint.*at.* file .*$srcfile, line $bp_location1\\." \
@@ -141,7 +141,6 @@ if {$hp_aCC_compiler} {
 
 set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
 set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
-set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
 
 gdb_test "info break" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
@@ -192,7 +191,7 @@ gdb_test "hbreak \"marker2\"" \
     "Hardware assisted breakpoint.*at.* file .*$srcfile1, line.*" \
     "hardware breakpoint quoted function (2)"
 gdb_test "continue" \
-    "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*" \
+    "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:$bp_location8.*" \
     "run until quoted breakpoint"
 delete_breakpoints
 #
@@ -394,7 +393,7 @@ gdb_test "hbreak \$foo" \
 # Verify that we can set and trigger a breakpoint in a user-called function.
 #
 gdb_test "hbreak marker2" \
-    "Hardware assisted breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*" \
+    "Hardware assisted breakpoint (\[0-9\]*) at .*, line $bp_location8.*" \
     "set hardware breakpoint on to-be-called function"
 
 gdb_test "print marker2(99)" \
@@ -408,10 +407,10 @@ gdb_test "print marker2(99)" \
 # for hppa*-*-hpux.
 #
 gdb_test_multiple "bt" "backtrace while in called function" {
-    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*_sr4export.*$gdb_prompt $" {
+    -re "#0\[ \t\]*($hex in )?marker2.*:$bp_location8\r\n#1.*_sr4export.*$gdb_prompt $" {
 	pass "backtrace while in called function"
     }
-    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*function called from gdb.*$gdb_prompt $" {
+    -re "#0\[ \t\]*($hex in )?marker2.*:$bp_location8\r\n#1.*function called from gdb.*$gdb_prompt $" {
 	pass "backtrace while in called function"
     }
 }
@@ -421,13 +420,13 @@ gdb_test_multiple "bt" "backtrace while in called function" {
 # breakpoint inserted by GDB at the program's entry point.
 #
 gdb_test_multiple "finish" "finish from called function" {
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.* in _sr4export.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.* in _sr4export.*$gdb_prompt $" {
 	pass "finish from called function"
     }
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*function called from gdb.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.*function called from gdb.*$gdb_prompt $" {
 	pass "finish from called function"
     }
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*Value returned.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.*Value returned.*$gdb_prompt $" {
 	pass "finish from called function"
     }
 }
@@ -577,19 +576,11 @@ gdb_test "hbreak marker4" \
 # has no exactly matching line symbol, and GDB reports the breakpoint
 # as if it were in the middle of a line rather than at the beginning.
 
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
 set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
 
 gdb_test_multiple "continue" \
     "run until hardware breakpoint set at small function, optimized file" {
-	-re "Breakpoint $decimal, marker4 \\(d=(d@entry=)?177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
-	    pass "run until hardware breakpoint set at small function, optimized file"
-	}
-	-re "Breakpoint $decimal, $hex in marker4 \\(d=(d@entry=)?177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
-	    pass "run until hardware breakpoint set at small function, optimized file"
-	}
 	-re "Breakpoint $decimal, marker4 \\(d=(d@entry=)?177601976\\) at .*$srcfile1:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
-	    # marker4() is defined at line 46 when compiled with -DPROTOTYPES
 	    pass "run until hardware breakpoint set at small function, optimized file (line bp_location14)"
 	}
 	-re "Breakpoint $decimal, factorial \\(.*\\) .*\{\r\n$gdb_prompt" {
diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp
index db643fa..b8a74ae 100644
--- a/gdb/testsuite/gdb.reverse/until-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/until-precsave.exp
@@ -31,7 +31,7 @@ if { [prepare_for_testing $testfile.exp $testfile \
 
 set bp_location1  [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location7  [gdb_get_line_number "set breakpoint 7 here"]
-set bp_location9  [gdb_get_line_number "set breakpoint 9 here" "$srcfile2"]
+set bp_location8  [gdb_get_line_number "set breakpoint 8 here" "$srcfile2"]
 set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
 set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
 set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
@@ -102,7 +102,7 @@ gdb_test "finish" \
 # Advance to a function called by main (marker2)
 #
 gdb_test "advance marker2" \
-    "marker2 .a=43.*$srcfile2:$bp_location9.*" \
+    "marker2 .a=43.*$srcfile2:$bp_location8.*" \
     "advance to marker2"
 
 # Now issue an until with another function, not called by the current
@@ -133,7 +133,7 @@ gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 #
 
 gdb_test "advance marker2" \
-    "marker2 .a=43.*$srcfile2:$bp_location9.*" \
+    "marker2 .a=43.*$srcfile2:$bp_location8.*" \
     "reverse-advance to marker2"
 
 # Finish out to main scope (backward)
diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp
index b6c3e54..389d892 100644
--- a/gdb/testsuite/gdb.reverse/until-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/until-reverse.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing $testfile.exp $testfile \
 
 set bp_location1  [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location7  [gdb_get_line_number "set breakpoint 7 here"]
-set bp_location9  [gdb_get_line_number "set breakpoint 9 here" "$srcfile2"]
+set bp_location8  [gdb_get_line_number "set breakpoint 8 here" "$srcfile2"]
 set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
 set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
 set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
@@ -70,7 +70,7 @@ gdb_test "finish" \
 # Advance to a function called by main (marker2)
 #
 gdb_test "advance marker2" \
-    "marker2 .a=43.*$srcfile2:$bp_location9.*" \
+    "marker2 .a=43.*$srcfile2:$bp_location8.*" \
     "advance to marker2"
 
 # Now issue an until with another function, not called by the current
@@ -101,7 +101,7 @@ gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 #
 
 gdb_test "advance marker2" \
-    "marker2 .a=43.*$srcfile2:$bp_location9.*" \
+    "marker2 .a=43.*$srcfile2:$bp_location8.*" \
     "reverse-advance to marker2"
 
 # Finish out to main scope (backward)
-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings
  2014-11-14 18:47 [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Andreas Arnez
                   ` (2 preceding siblings ...)
  2014-11-14 18:47 ` [PATCH 3/3] GDB testsuite: More fixes for warnings with -std=gnu11 Andreas Arnez
@ 2014-11-15 19:44 ` Doug Evans
  2014-11-17  9:02   ` Andreas Arnez
  3 siblings, 1 reply; 6+ messages in thread
From: Doug Evans @ 2014-11-15 19:44 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On Fri, Nov 14, 2014 at 10:47 AM, Andreas Arnez
<arnez@linux.vnet.ibm.com> wrote:
> It seems that my earlier testsuite cleanup has left some test cases in
> a broken state.  The first two patches fix (at least some of) these.
> I'm sorry for the breakage and hope that I didn't miss anything else.
>
> The third patch fixes some more compiler warnings I've overlooked
> before.
>
> Andreas Arnez (3):
>   Drop remaining references to removed source lines in break1.c and
>     ur1.c
>   Eliminate literal line numbers in mi-until.exp
>   GDB testsuite: More fixes for warnings with -std=gnu11
>
>  gdb/testsuite/gdb.base/bp-permanent.c        |  1 +
>  gdb/testsuite/gdb.base/condbreak.exp         | 28 ++++++++++++----------------
>  gdb/testsuite/gdb.base/ena-dis-br.exp        | 26 +++++++++++---------------
>  gdb/testsuite/gdb.base/hbreak2.exp           | 25 ++++++++-----------------
>  gdb/testsuite/gdb.mi/mi-until.exp            | 23 +++++++++++++++--------
>  gdb/testsuite/gdb.mi/until.c                 | 10 +++++-----
>  gdb/testsuite/gdb.python/py-framefilter-mi.c |  3 ++-
>  gdb/testsuite/gdb.python/py-framefilter.c    |  3 ++-
>  gdb/testsuite/gdb.reverse/until-precsave.exp |  6 +++---
>  gdb/testsuite/gdb.reverse/until-reverse.exp  |  6 +++---
>  gdb/testsuite/gdb.trace/actions-changed.c    |  3 +++
>  11 files changed, 65 insertions(+), 69 deletions(-)

Hi.

This patch set is ok.
Please commit ASAP. :-)

No worries on the breakage ... live and learn ...
And besides, thanks very much for taking this on!

btw,
the following violates the coding standards.
We're trying to be follow them more closely in the testsuite.
I don't mind it, but you might as well fix them.
[function result type goes on a line by itself]

diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.c
b/gdb/testsuite/gdb.python/py-framefilter-mi.c
index 242efa1..2955b71 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-mi.c
+++ b/gdb/testsuite/gdb.python/py-framefilter-mi.c
@@ -132,7 +132,8 @@ int func5(int f, int d)
   return i;
 }

-main()
+int main()
 {
   func5(3,5);
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.python/py-framefilter.c
b/gdb/testsuite/gdb.python/py-framefilter.c
index 80087c2..3102dda 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.c
+++ b/gdb/testsuite/gdb.python/py-framefilter.c
@@ -146,10 +146,11 @@ int func5(int f, int d)
   return i;
 }

-main()
+int main()
 {
   int z = 32;
   int y = 44;
   const char *foo1 = "Test";
   func5(3,5);
+  return 0;
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings
  2014-11-15 19:44 ` [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Doug Evans
@ 2014-11-17  9:02   ` Andreas Arnez
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Arnez @ 2014-11-17  9:02 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Sat, Nov 15 2014, Doug Evans wrote:

> On Fri, Nov 14, 2014 at 10:47 AM, Andreas Arnez
> <arnez@linux.vnet.ibm.com> wrote:
>> It seems that my earlier testsuite cleanup has left some test cases in
>> a broken state.  The first two patches fix (at least some of) these.
>> I'm sorry for the breakage and hope that I didn't miss anything else.
>>
>> The third patch fixes some more compiler warnings I've overlooked
>> before.
>>
>> Andreas Arnez (3):
>>   Drop remaining references to removed source lines in break1.c and
>>     ur1.c
>>   Eliminate literal line numbers in mi-until.exp
>>   GDB testsuite: More fixes for warnings with -std=gnu11
>>
>>  gdb/testsuite/gdb.base/bp-permanent.c        |  1 +
>>  gdb/testsuite/gdb.base/condbreak.exp         | 28 ++++++++++++----------------
>>  gdb/testsuite/gdb.base/ena-dis-br.exp        | 26 +++++++++++---------------
>>  gdb/testsuite/gdb.base/hbreak2.exp           | 25 ++++++++-----------------
>>  gdb/testsuite/gdb.mi/mi-until.exp            | 23 +++++++++++++++--------
>>  gdb/testsuite/gdb.mi/until.c                 | 10 +++++-----
>>  gdb/testsuite/gdb.python/py-framefilter-mi.c |  3 ++-
>>  gdb/testsuite/gdb.python/py-framefilter.c    |  3 ++-
>>  gdb/testsuite/gdb.reverse/until-precsave.exp |  6 +++---
>>  gdb/testsuite/gdb.reverse/until-reverse.exp  |  6 +++---
>>  gdb/testsuite/gdb.trace/actions-changed.c    |  3 +++
>>  11 files changed, 65 insertions(+), 69 deletions(-)
>
> Hi.
>
> This patch set is ok.
> Please commit ASAP. :-)

Thanks!  Will do.

> No worries on the breakage ... live and learn ...
> And besides, thanks very much for taking this on!
>
> btw,
> the following violates the coding standards.
> We're trying to be follow them more closely in the testsuite.
> I don't mind it, but you might as well fix them.
> [function result type goes on a line by itself]

OK, I'll fix these two.

> diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.c
> b/gdb/testsuite/gdb.python/py-framefilter-mi.c
> index 242efa1..2955b71 100644
> --- a/gdb/testsuite/gdb.python/py-framefilter-mi.c
> +++ b/gdb/testsuite/gdb.python/py-framefilter-mi.c
> @@ -132,7 +132,8 @@ int func5(int f, int d)
>    return i;
>  }
>
> -main()
> +int main()
>  {
>    func5(3,5);
> +  return 0;
>  }
> diff --git a/gdb/testsuite/gdb.python/py-framefilter.c
> b/gdb/testsuite/gdb.python/py-framefilter.c
> index 80087c2..3102dda 100644
> --- a/gdb/testsuite/gdb.python/py-framefilter.c
> +++ b/gdb/testsuite/gdb.python/py-framefilter.c
> @@ -146,10 +146,11 @@ int func5(int f, int d)
>    return i;
>  }
>
> -main()
> +int main()
>  {
>    int z = 32;
>    int y = 44;
>    const char *foo1 = "Test";
>    func5(3,5);
> +  return 0;
>  }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-17  9:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 18:47 [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Andreas Arnez
2014-11-14 18:47 ` [PATCH 2/3] Eliminate literal line numbers in mi-until.exp Andreas Arnez
2014-11-14 18:47 ` [PATCH 1/3] Drop remaining references to removed source lines in break1.c and ur1.c Andreas Arnez
2014-11-14 18:47 ` [PATCH 3/3] GDB testsuite: More fixes for warnings with -std=gnu11 Andreas Arnez
2014-11-15 19:44 ` [PATCH 0/3] Fix fallout from GDB testsuite cleanup, fix more compiler warnings Doug Evans
2014-11-17  9:02   ` Andreas Arnez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).