From 4f204ea54e2b80354d03dea210047137a09ceae2 Mon Sep 17 00:00:00 2001 From: Andreas Arnez Date: Wed, 22 Oct 2014 17:13:34 +0000 Subject: [PATCH] Drop non-prototype C function header variants: 'list' test case Remove old-style function header variants from list0.h and list1.c. Fill the removed lines with comments or empty lines, such that the line numbering is undisturbed. Changes to the line numbering would require heavy adjustments to list.exp, where many line numbers are hard-coded, as well as a fair amount of knowledge about the source code in and around certain lines. Thus the dependency on the line numbering can not be eliminated so easily, and it may not even be a useful goal for a "list" test case. Another option might be to adjust the literal line numbers in list.exp, but even that is not as straightforward as it may seem, since the test case expects certain source lines to be exactly n lines apart. gdb/testsuite/ChangeLog: * gdb.base/list0.h: Remove #ifdef PROTOTYPES, keep prototyped variant. Preserve original line numbering. * gdb.base/list1.c: Likewise. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/list0.h | 8 ++++---- gdb/testsuite/gdb.base/list1.c | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b409af5e1eb..e67ab40c32e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-11-13 Andreas Arnez + + * gdb.base/list0.h: Remove #ifdef PROTOTYPES, keep prototyped + variant. Preserve original line numbering. + * gdb.base/list1.c: Likewise. + 2014-11-13 Andreas Arnez * gdb.base/break.c: Remove #ifdef PROTOTYPES, keep prototyped diff --git a/gdb/testsuite/gdb.base/list0.h b/gdb/testsuite/gdb.base/list0.h index d46833060e5..42a4fe0f03a 100644 --- a/gdb/testsuite/gdb.base/list0.h +++ b/gdb/testsuite/gdb.base/list0.h @@ -1,10 +1,10 @@ /* An include file that actually causes code to be generated in the including file. This is known to cause problems on some systems. */ -#ifdef PROTOTYPES + extern void bar(int); static void foo (int x) -#else -static void foo (x) int x; -#endif +/* ! + ! + ! */ { bar (x++); bar (x++); diff --git a/gdb/testsuite/gdb.base/list1.c b/gdb/testsuite/gdb.base/list1.c index 6094104b9cd..a9f614f2f64 100644 --- a/gdb/testsuite/gdb.base/list1.c +++ b/gdb/testsuite/gdb.base/list1.c @@ -1,11 +1,11 @@ #include -#ifdef PROTOTYPES + void long_line (); int oof (int); void bar (int x) -#else -void bar (x) int x; -#endif +/* - + - + - */ { printf ("%d\n", x); @@ -18,9 +18,9 @@ unused () /* Not used for anything */ } /* This routine has a very long line that will break searching in older versions of GDB. */ -#ifdef PROTOTYPES + void -#endif + long_line () { oof (67); @@ -29,11 +29,11 @@ long_line () oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 5 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 10 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 15 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 20 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 25 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 30 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 35 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 40 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 45 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 50 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 55 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 60 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 65 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (1234); /* 70 */ } -#ifdef PROTOTYPES + int oof (int n) -#else -oof (n) int n; -#endif +/* o + o + o */ { return n + 1; } -- 2.30.2