Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Results of macscp.exp test on cygwin
@ 2008-10-09 11:37 Pierre Muller
  2008-10-09 16:29 ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2008-10-09 11:37 UTC (permalink / raw)
  To: gdb-patches

  Following a recent email about the testsuite that I 
ran on cygwin, where Pedro fond that the
number of failures was very high, I started to 
look into this. 

 Cygwin target uses stabs debugging format as a default,
but stabs doesn't generate any macro debugging information,
which results in 244 FAIL's (87 KFAIL plus 157 FAIL) from this unique test.

 Shouldn't we force dwarf-2 debug format, or at least 
skip the test if only stabs format is available?

 The test just add "-g3" option to the compilation command line
and that does not switch over to dwarf-2 debugging format.

Using 
make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=\"gcc -gstabs+\""
I get 67 PASS, 87 KFAIL and 157 FAIL.

The strange thing is that even with
make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=\"gcc
-gdwarf-2\""
(gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125))
I still get the same results :(

Only if I force the use of gcc version 4 (gcc version 4.3.2 20080827
(alpha-testing) 1 (GCC))
make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=\"gcc-4
-gdwarf-2\""  
do I get good results:
PASSES: 286 FAIL:6 KFAIL:19
FAIL: gdb.base/macscp.exp: c99 varargs expansion
FAIL: gdb.base/macscp.exp: c99 varargs expansion without an argument
FAIL: gdb.base/macscp.exp: c99 varargs expansion, multiple formal arguments
FAIL: gdb.base/macscp.exp: gnu varargs expansion
FAIL: gdb.base/macscp.exp: gnu varargs expansion without an argument
FAIL: gdb.base/macscp.exp: gnu varargs expansion special splicing without an
argument
These failures are all due to the fact that stderr
is itself a macro in cygwin that is expanded into
"((__getreent())->_stderr)".

I also checked that gcc-4 with stabs, and I also get the 87 KFAIL and 157
FAIL.
 
  So all these tests seem to require gcc version 4, and explicit 
dwarf-2 selection.

  Is gcc version 3 still being developed?
If not, we could probably just fail generally once 
and skip the whole rest of the test if gcc version 3 is used.

  Should we add something to force use of 'dwarf-2' debug format?
Or at least also fail only once if stabs is used and skip the rest?


Pierre Muller
Pascal language support maintainer for GDB






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

* Re: Results of macscp.exp test on cygwin
  2008-10-09 11:37 Results of macscp.exp test on cygwin Pierre Muller
@ 2008-10-09 16:29 ` Tom Tromey
  2008-10-09 16:46   ` Pedro Alves
                     ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Tom Tromey @ 2008-10-09 16:29 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:

Pierre>  Shouldn't we force dwarf-2 debug format, or at least 
Pierre> skip the test if only stabs format is available?

Seems like a decent idea to me.

Pierre> FAIL: gdb.base/macscp.exp: c99 varargs expansion
[...]

Pierre> These failures are all due to the fact that stderr
Pierre> is itself a macro in cygwin that is expanded into
Pierre> "((__getreent())->_stderr)".

These tests don't really require the use of fprintf or stderr -- any
arbitrary identifier is fine.  I'm testing this patch, which changes
these names.

Ok if it passes testing?

Tom

:ADDPATCH testsuite:

2008-10-09  Tom Tromey  <tromey@redhat.com>

	* gdb.base/macscp.exp: Use 'vafunc' and 'fixedarg' rather than
	'fprintf' and 'stderr'.

diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
index 2a43a28..40546f9 100644
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -566,44 +566,44 @@ gdb_test "macro expand SPLICE(robot, invasion)" \
 
 # Varargs tests.
 
-gdb_test "macro define va_c99(...) fprintf (stderr, __VA_ARGS__)" \
+gdb_test "macro define va_c99(...) varfunc (fixedarg, __VA_ARGS__)" \
   "" \
   "define first varargs helper"
 
-gdb_test "macro define va2_c99(x, y, ...) fprintf (stderr, x, y, __VA_ARGS__)" \
+gdb_test "macro define va2_c99(x, y, ...) varfunc (fixedarg, x, y, __VA_ARGS__)" \
   "" \
   "define second varargs helper"
 
-gdb_test "macro define va_gnu(args...) fprintf (stderr, args)" \
+gdb_test "macro define va_gnu(args...) varfunc (fixedarg, args)" \
   "" \
   "define third varargs helper"
 
-gdb_test "macro define va2_gnu(args...) fprintf (stderr, ## args)" \
+gdb_test "macro define va2_gnu(args...) varfunc (fixedarg, ## args)" \
   "" \
   "define fourth varargs helper"
 
 gdb_test "macro expand va_c99(one, two, three)" \
-  "expands to: *fprintf \\(stderr, *one, two, three\\)" \
+  "expands to: *varfunc \\(fixedarg, *one, two, three\\)" \
   "c99 varargs expansion"
 
 gdb_test "macro expand va_c99()" \
-  "expands to: *fprintf \\(stderr, *\\)" \
+  "expands to: *varfunc \\(fixedarg, *\\)" \
   "c99 varargs expansion without an argument"
 
 gdb_test "macro expand va2_c99(one, two, three, four)" \
-  "expands to: *fprintf \\(stderr, *one, two, three, four\\)" \
+  "expands to: *varfunc \\(fixedarg, *one, two, three, four\\)" \
   "c99 varargs expansion, multiple formal arguments"
 
 gdb_test "macro expand va_gnu(one, two, three, four)" \
-  "expands to: *fprintf \\(stderr, *one, two, three, four\\)" \
+  "expands to: *varfunc \\(fixedarg, *one, two, three, four\\)" \
   "gnu varargs expansion"
 
 gdb_test "macro expand va_gnu()" \
-  "expands to: *fprintf \\(stderr, *\\)" \
+  "expands to: *varfunc \\(fixedarg, *\\)" \
   "gnu varargs expansion without an argument"
 
 gdb_test "macro expand va2_gnu()" \
-  "expands to: *fprintf \\(stderr\\)" \
+  "expands to: *varfunc \\(fixedarg\\)" \
   "gnu varargs expansion special splicing without an argument"
 
 # Stringification tests.


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

* Re: Results of macscp.exp test on cygwin
  2008-10-09 16:29 ` Tom Tromey
@ 2008-10-09 16:46   ` Pedro Alves
  2008-10-09 18:14   ` Daniel Jacobowitz
  2008-10-10 16:04   ` [RFC] " Pierre Muller
  2 siblings, 0 replies; 17+ messages in thread
From: Pedro Alves @ 2008-10-09 16:46 UTC (permalink / raw)
  To: gdb-patches, tromey; +Cc: Pierre Muller

On Thursday 09 October 2008 17:27:07, Tom Tromey wrote:
> These tests don't really require the use of fprintf or stderr -- any
> arbitrary identifier is fine.  I'm testing this patch, which changes
> these names.
> 
> Ok if it passes testing?

Sure thing.  Thanks.

-- 
Pedro Alves


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

* Re: Results of macscp.exp test on cygwin
  2008-10-09 16:29 ` Tom Tromey
  2008-10-09 16:46   ` Pedro Alves
@ 2008-10-09 18:14   ` Daniel Jacobowitz
  2008-10-09 20:21     ` Michael Snyder
  2008-10-10 16:04   ` [RFC] " Pierre Muller
  2 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2008-10-09 18:14 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Pierre Muller, gdb-patches

On Thu, Oct 09, 2008 at 10:27:07AM -0600, Tom Tromey wrote:
> >>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
> 
> Pierre>  Shouldn't we force dwarf-2 debug format, or at least 
> Pierre> skip the test if only stabs format is available?
> 
> Seems like a decent idea to me.

Yes; I suggest skipping, rather than forcing.  There should be some
examples of this in the testsuite already.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: Results of macscp.exp test on cygwin
  2008-10-09 18:14   ` Daniel Jacobowitz
@ 2008-10-09 20:21     ` Michael Snyder
  2008-10-09 22:28       ` Paul Pluzhnikov
  0 siblings, 1 reply; 17+ messages in thread
From: Michael Snyder @ 2008-10-09 20:21 UTC (permalink / raw)
  To: Tom Tromey, Pierre Muller, gdb-patches

Daniel Jacobowitz wrote:
> On Thu, Oct 09, 2008 at 10:27:07AM -0600, Tom Tromey wrote:
>>>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
>> Pierre>  Shouldn't we force dwarf-2 debug format, or at least
>> Pierre> skip the test if only stabs format is available?
>>
>> Seems like a decent idea to me.
> 
> Yes; I suggest skipping, rather than forcing.  There should be some
> examples of this in the testsuite already.

Regarding macscp.exp, I am running it on RHEL-4 and seeing
the majority of tests fail.

bash-3.00$ gcc --version
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


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

* Re: Results of macscp.exp test on cygwin
  2008-10-09 20:21     ` Michael Snyder
@ 2008-10-09 22:28       ` Paul Pluzhnikov
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Pluzhnikov @ 2008-10-09 22:28 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Tom Tromey, Pierre Muller, gdb-patches

On Thu, Oct 9, 2008 at 1:18 PM, Michael Snyder <msnyder@vmware.com> wrote:

> Regarding macscp.exp, I am running it on RHEL-4 and seeing
> the majority of tests fail.

I've seen these tests fail when switching from gcc-4.2.1 to
gcc-4.3.1, due to a bug in gcc (macro definitions had bogus line
numbers).

Perhaps your 'gcc' is similarly broken?
What does 'readelf -w a.out | grep DW_MACINFO_start_file' say?

Fix for gcc-4.3 is here:
http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00726.html

-- 
Paul Pluzhnikov


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

* [RFC] RE: Results of macscp.exp test on cygwin
  2008-10-09 16:29 ` Tom Tromey
  2008-10-09 16:46   ` Pedro Alves
  2008-10-09 18:14   ` Daniel Jacobowitz
@ 2008-10-10 16:04   ` Pierre Muller
  2009-01-26  9:13     ` [PING] " Pierre Muller
  2 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2008-10-10 16:04 UTC (permalink / raw)
  To: tromey, gdb-patches

  Just a small note to confirm that
your commit did remove all FAIL for
make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=\"gcc-4
-gdwarf-2\""  

I now only get 19 KFAIL, all tagged as PRMS gdb/555.

  But as said in my first email,
on cygwin, in order to get those good results, you need both
to use gcc version 4 and explicit dwarf-2 debug format.

  Thanks, Tom!
  
  
  Daniel, suggested to skip the test
rather than forcing anything, but my knowledge of dejagnu
is poor.

  I tried to write a patch.

 First , I added a check for gcc version, and skip the test if main version
is >=3
(first part of the patch below).

 Second, for the debugging format, I used the result of 'info source'
command 
as in gdb.exp get_debug_format procedure.
This only only works if the debuggee
is already started, so I postponed the test after 
the runto_main command.
  This generates 5 FAIL but when I tried to 
move the runto_main earlier in the macscp.exp
I generated new failures for the "working case" i.e. gcc version 4.3.2.

  By the way, I discovered while doing this that for
gcc-4 dwarf-2 is the default debugging format for cygwin target.
Thus:
make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=gcc-4"  
also gives me "292 PASS and 19 KFAIL"

  I wanted to give an explanation of the reasons of the skipping,
and I first inserted this into the untested procedure argument,
but I later saw that this argument seems to always be a filename,
this is the reason of the use of the warning function,
but I am also not really sure that warning is the correct function
to use in such a case...


Pierre Muller
Pascal language support maintainer for GDB


gdb/testsuite ChangeLog entry:

2008-10-10  Pierre Muller  <muller@ics.u-strasbg.fr>

	* gdb.base/macscp.exp: Skip test if gcc version below 4
	or if preprocessor macro information is not available.

Index: gdb.base/macscp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
retrieving revision 1.15
diff -u -p -r1.15 macscp.exp
--- gdb.base/macscp.exp 9 Oct 2008 16:49:47 -0000       1.15
+++ gdb.base/macscp.exp 10 Oct 2008 16:01:04 -0000
@@ -42,6 +42,14 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}

+if {[info exists gcc_compiled] && ($gcc_compiled >= 4)} {
+  # we are using gcc version 4.X.X
+  # Lets continue the test
+} else {
+  warning "macscp.exp test skipped because gcc version is $gcc_compiled"
+  untested macscp.exp
+  return -1
+}

 # Ask GDB to show the current definition of MACRO, and return a list
 # describing the result.
@@ -322,6 +330,52 @@ foreach func_entry $funcs {
     gdb_test "break $func" "Breakpoint.*"
 }

+global macro_support
+
+set macro_support "unknown"
+
+proc get_macro_support { } {
+    global gdb_prompt
+    global verbose
+    global macro_support
+
+    send_gdb "info source\n"
+    gdb_expect 10 {
+       -re "Includes preprocessor macro info.\r\n.*$gdb_prompt $" {
+           set macro_support 1
+           verbose "Source has macro information"
+           return 1;
+       }
+       -re "Does not include preprocessor macro info.\r\n.*$gdb_prompt $" {
+           set macro_support 0
+           verbose "Source has no macro information"
+           return 1;
+       }
+       -re "No current source file.\r\n$gdb_prompt $" {
+           perror "get_macro_support used when no current source file"
+           return 0;
+       }
+       -re "$gdb_prompt $" {
+           warning "couldn't check macro support (no valid response)."
+           return 1;
+       }
+       timeout {
+           warning "couldn't check macro support (timed out)."
+           return 1;
+       }
+    }
+}
+
+get_macro_support
+
+if {$macro_support != 1} {
+  warning "macscp.exp test skipped because source has no macro information"
+  untested macscp.exp
+  return -1
+}
+
+
+
 # Run to each of the breakpoints and check the definition (or lack
 # thereof) of each macro.
 for {set i 0} {$i < [llength $funcs]} {incr i} {


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

* [PING] [RFC] RE: Results of macscp.exp test on cygwin
  2008-10-10 16:04   ` [RFC] " Pierre Muller
@ 2009-01-26  9:13     ` Pierre Muller
  2009-01-28 13:32       ` [RFC] Use untested for macscp.exp if no macro information generated Pierre Muller
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2009-01-26  9:13 UTC (permalink / raw)
  To: gdb-patches

  I got no comments on this RFC,
could someone give me some feedback, please?



Pierre Muller
Pascal language support maintainer for GDB



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pierre Muller
> Envoyé : Friday, October 10, 2008 6:04 PM
> À : tromey@redhat.com; gdb-patches@sourceware.org
> Objet : [RFC] RE: Results of macscp.exp test on cygwin
> 
>   Just a small note to confirm that
> your commit did remove all FAIL for
> make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=\"gcc-4
> -gdwarf-2\""
> 
> I now only get 19 KFAIL, all tagged as PRMS gdb/555.
> 
>   But as said in my first email,
> on cygwin, in order to get those good results, you need both
> to use gcc version 4 and explicit dwarf-2 debug format.
> 
>   Thanks, Tom!
> 
> 
>   Daniel, suggested to skip the test
> rather than forcing anything, but my knowledge of dejagnu
> is poor.
> 
>   I tried to write a patch.
> 
>  First , I added a check for gcc version, and skip the test if main
> version
> is >=3
> (first part of the patch below).
> 
>  Second, for the debugging format, I used the result of 'info source'
> command
> as in gdb.exp get_debug_format procedure.
> This only only works if the debuggee
> is already started, so I postponed the test after
> the runto_main command.
>   This generates 5 FAIL but when I tried to
> move the runto_main earlier in the macscp.exp
> I generated new failures for the "working case" i.e. gcc version 4.3.2.
> 
>   By the way, I discovered while doing this that for
> gcc-4 dwarf-2 is the default debugging format for cygwin target.
> Thus:
> make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=gcc-4"
> also gives me "292 PASS and 19 KFAIL"
> 
>   I wanted to give an explanation of the reasons of the skipping,
> and I first inserted this into the untested procedure argument,
> but I later saw that this argument seems to always be a filename,
> this is the reason of the use of the warning function,
> but I am also not really sure that warning is the correct function
> to use in such a case...
> 
> 
> Pierre Muller
> Pascal language support maintainer for GDB
> 
> 
> gdb/testsuite ChangeLog entry:
> 
> 2008-10-10  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* gdb.base/macscp.exp: Skip test if gcc version below 4
> 	or if preprocessor macro information is not available.
> 
> Index: gdb.base/macscp.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
> retrieving revision 1.15
> diff -u -p -r1.15 macscp.exp
> --- gdb.base/macscp.exp 9 Oct 2008 16:49:47 -0000       1.15
> +++ gdb.base/macscp.exp 10 Oct 2008 16:01:04 -0000
> @@ -42,6 +42,14 @@ gdb_start
>  gdb_reinitialize_dir $srcdir/$subdir
>  gdb_load ${binfile}
> 
> +if {[info exists gcc_compiled] && ($gcc_compiled >= 4)} {
> +  # we are using gcc version 4.X.X
> +  # Lets continue the test
> +} else {
> +  warning "macscp.exp test skipped because gcc version is
> $gcc_compiled"
> +  untested macscp.exp
> +  return -1
> +}
> 
>  # Ask GDB to show the current definition of MACRO, and return a list
>  # describing the result.
> @@ -322,6 +330,52 @@ foreach func_entry $funcs {
>      gdb_test "break $func" "Breakpoint.*"
>  }
> 
> +global macro_support
> +
> +set macro_support "unknown"
> +
> +proc get_macro_support { } {
> +    global gdb_prompt
> +    global verbose
> +    global macro_support
> +
> +    send_gdb "info source\n"
> +    gdb_expect 10 {
> +       -re "Includes preprocessor macro info.\r\n.*$gdb_prompt $" {
> +           set macro_support 1
> +           verbose "Source has macro information"
> +           return 1;
> +       }
> +       -re "Does not include preprocessor macro info.\r\n.*$gdb_prompt
> $" {
> +           set macro_support 0
> +           verbose "Source has no macro information"
> +           return 1;
> +       }
> +       -re "No current source file.\r\n$gdb_prompt $" {
> +           perror "get_macro_support used when no current source file"
> +           return 0;
> +       }
> +       -re "$gdb_prompt $" {
> +           warning "couldn't check macro support (no valid response)."
> +           return 1;
> +       }
> +       timeout {
> +           warning "couldn't check macro support (timed out)."
> +           return 1;
> +       }
> +    }
> +}
> +
> +get_macro_support
> +
> +if {$macro_support != 1} {
> +  warning "macscp.exp test skipped because source has no macro
> information"
> +  untested macscp.exp
> +  return -1
> +}
> +
> +
> +
>  # Run to each of the breakpoints and check the definition (or lack
>  # thereof) of each macro.
>  for {set i 0} {$i < [llength $funcs]} {incr i} {


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

* [RFC] Use untested for macscp.exp if no macro information generated
  2009-01-26  9:13     ` [PING] " Pierre Muller
@ 2009-01-28 13:32       ` Pierre Muller
  2009-02-01 18:28         ` Daniel Jacobowitz
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2009-01-28 13:32 UTC (permalink / raw)
  To: gdb-patches


I tried to simplify my patch for macro support
in order to get less uninteresting failures.

This test issues a huge number of failures if the
debugging format does not support macro information.
This is the default for gcc-3 on cygwin.

make check RUNTESTFLAGS=gdb.base/macscp.exp
results currently in:
                === gdb Summary ===

# of expected passes            69
# of unexpected failures        158
# of known failures             87
/usr/local/src/gdbcvs/build/gdb/testsuite/../../gdb/gdb version
6.8.50.20090127-cvs -nw -nx

By forcing gcc-4 usage, 
make check RUNTESTFLAGS="gdb.base/macscp.exp CC_FOR_TARGET=gcc-4"
                === gdb Summary ===

# of expected passes            295
# of known failures             19
/usr/local/src/gdbcvs/build/gdb/testsuite/../../gdb/gdb version
6.8.50.20090127-cvs -nw -nx


After this patch:
make check RUNTESTFLAGS=gdb.base/macscp.exp
results currently in:
                === gdb Summary ===
FAIL: gdb.base/macscp.exp: info macro WHERE after `list main' (undefined)

                === gdb Summary ===

# of expected passes            1
# of unexpected failures        1
# of untested testcases         1
/usr/local/src/gdbcvs/build/gdb/testsuite/../../gdb/gdb version
6.8.50.20090127-cvs -nw -nx

The gcc-4 case remains unchanged
which means that targets supporting macro debug information
should remain unaffected by this patch.

 Is this lighter version OK?

  Once again, I was hesitating on the ChangeLog
description...



Pierre Muller
Pascal language support maintainer for GDB



gdb/testsuite/ChangeLog entry:

2009-01-28  Pierre Muller  <muller@ics.u-strasbg.fr>

	* gdb.base/macscp.exp (info_macro): Return undefined if undefined.
	(check_macro): Return 1 if undefined.
	If first test fails, check if macro debug information is available,
	and skip test completely if no macro information found.


Index: gdb/testsuite/gdb.base/macscp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
retrieving revision 1.19
diff -u -p -r1.19 macscp.exp
--- gdb/testsuite/gdb.base/macscp.exp	3 Jan 2009 05:58:03 -0000	1.19
+++ gdb/testsuite/gdb.base/macscp.exp	28 Jan 2009 13:02:15 -0000
@@ -152,7 +152,7 @@ proc info_macro {macro} {
     switch -exact -- $definition {
         no-macro-info { return no-macro-info }
         timeout { return timeout }
-        undefined -
+        undefined { return undefined }
         default {
             if {[llength $location] >= 1} {
                 return [concat $location [list $definition]]
@@ -178,6 +178,10 @@ proc check_macro {macro expected where} 
                 xfail "executable includes no macro debugging information"
                 return 1
             }
+	    undefined {
+		fail "info macro $macro $where (undefined)"
+		return 1
+	    }
             timeout {
                 fail "info macro $macro $where (timeout)"
             }
@@ -199,7 +203,33 @@ proc list_and_check_macro {func macro ex
 
 
 if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
-    return 0
+    global verbose
+    set macro_support "unknown"
+    send_gdb "info source\n"
+    gdb_expect 10 {
+	-re "Includes preprocessor macro info\..*$gdb_prompt $" {
+	    set macro_support 1
+	    verbose "Source has macro information"
+	}
+	-re "Does not include preprocessor macro info\..*$gdb_prompt $" {
+	    set macro_support 0
+	    verbose "Source has no macro information"
+	}
+	-re "No current source file.*$gdb_prompt $" {
+	    perror "get_macro_support used when no current source file"
+	}
+	-re "$gdb_prompt $" {
+	    warning "couldn't check macro support (no valid response)."
+	}
+	timeout {
+	    warning "couldn't check macro support (timed out)."
+	}
+    }
+    if {$macro_support != 1} {
+	verbose "Skipping $testfile because no macro information is
included."
+	untested $testfile
+	return 0
+    }
 }
 list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before
macscp2_2}}
 list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before
macscp3_2}}


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

* Re: [RFC] Use untested for macscp.exp if no macro information  generated
  2009-01-28 13:32       ` [RFC] Use untested for macscp.exp if no macro information generated Pierre Muller
@ 2009-02-01 18:28         ` Daniel Jacobowitz
  2009-02-03 14:36           ` [RFC-v2] " Pierre Muller
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2009-02-01 18:28 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

On Wed, Jan 28, 2009 at 02:23:11PM +0100, Pierre Muller wrote:
> 
> I tried to simplify my patch for macro support
> in order to get less uninteresting failures.

I think your earlier patch had the right idea.  Why did it leave some
failures?  We should have none if we're going to skip the test.

>  if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
> -    return 0
> +    global verbose
> +    set macro_support "unknown"
> +    send_gdb "info source\n"
> +    gdb_expect 10 {

General note, please use gdb_test_multiple.  No need for a timeout in
most cases; use the default setting.

-- 
Daniel Jacobowitz
CodeSourcery


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

* [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-02-01 18:28         ` Daniel Jacobowitz
@ 2009-02-03 14:36           ` Pierre Muller
  2009-02-18 22:59             ` [PING] " Pierre Muller
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2009-02-03 14:36 UTC (permalink / raw)
  To: 'Daniel Jacobowitz'; +Cc: gdb-patches

Thanks for your feedback Daniel,


Here is a new lighter version.
I finally switch from untested to unsupported,
which seems closer to reality as it is an
unsupported feature (of the compiler).

 Again, the test with  "info source" only works once a source file is
loaded,
which is the reason why this test is not put at the very
start of macscp.exp.

With that patch,
doing
$ make check RUNTESTFLAGS="gdb.base/macscp.exp"
gives this:
$ cat gdb.sum
Test Run By Pierre on Tue Feb  3 15:24:03 2009
Native configuration is i686-pc-cygwin

                === gdb tests ===

Schedule of variations:
    unix

Running target unix
Running ../../../src/gdb/testsuite/gdb.base/macscp.exp ...
PASS: gdb.base/macscp.exp: list main
FAIL: gdb.base/macscp.exp: info macro WHERE after `list main' (undefined)
UNSUPPORTED: gdb.base/macscp.exp: Skipping test because debug information
does n
ot include macro information.

                === gdb Summary ===

# of expected passes            1
# of unexpected failures        1
# of unsupported tests          1
/usr/local/src/gdbcvs/build/gdb/testsuite/../../gdb/gdb version
6.8.50.20090203
-cvs -nw -nx
  



Pierre Muller
Pascal language support maintainer for GDB



gdb/testsuite/ChangeLog entry:

2009-02-03  Pierre Muller  <muller@ics.u-strasbg.fr>

	* gdb.base/macscp.exp (info_macro): Return undefined if undefined.
	(check_macro): Return 1 if undefined.
	If first test fails, check if macro debug information is available,
	and report unsupported test if no macro information is found.


Index: gdb/testsuite/gdb.base/macscp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
retrieving revision 1.19
diff -u -p -r1.19 macscp.exp
--- gdb/testsuite/gdb.base/macscp.exp	3 Jan 2009 05:58:03 -0000	1.19
+++ gdb/testsuite/gdb.base/macscp.exp	3 Feb 2009 14:24:55 -0000
@@ -152,7 +152,7 @@ proc info_macro {macro} {
     switch -exact -- $definition {
         no-macro-info { return no-macro-info }
         timeout { return timeout }
-        undefined -
+        undefined { return undefined }
         default {
             if {[llength $location] >= 1} {
                 return [concat $location [list $definition]]
@@ -178,6 +178,10 @@ proc check_macro {macro expected where} 
                 xfail "executable includes no macro debugging information"
                 return 1
             }
+	    undefined {
+		fail "info macro $macro $where (undefined)"
+		return 1
+	    }
             timeout {
                 fail "info macro $macro $where (timeout)"
             }
@@ -199,8 +203,28 @@ proc list_and_check_macro {func macro ex
 
 
 if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
-    return 0
+    global verbose
+    set macro_support "unknown"
+    send_gdb "info source\n"
+    gdb_test_multiple "info source" "Test macro information"  {
+	-re "Includes preprocessor macro info\..*$gdb_prompt $" {
+	    set macro_support 1
+	    verbose "Source has macro information"
+	}
+	-re "Does not include preprocessor macro info\..*$gdb_prompt $" {
+	    set macro_support 0
+	    verbose "Source has no macro information"
+	}
+	default {
+	    warning "couldn't check macro support (no valid response)."
+	}
+    }
+    if {$macro_support == 0} {
+	unsupported "Skipping test because debug information does not
include macro information."
+	return 0
+    }
 }
+ 
 list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before
macscp2_2}}
 list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before
macscp3_2}}
 


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

* [PING] [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-02-03 14:36           ` [RFC-v2] " Pierre Muller
@ 2009-02-18 22:59             ` Pierre Muller
  2009-02-19  8:20               ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2009-02-18 22:59 UTC (permalink / raw)
  To: 'Daniel Jacobowitz'; +Cc: gdb-patches

I didn't get any feedback on this one.
Should I resend it as a RFA?

Pierre Muller
Pascal language support maintainer for GDB



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pierre Muller
> Envoyé : Tuesday, February 03, 2009 3:37 PM
> À : 'Daniel Jacobowitz'
> Cc : gdb-patches@sourceware.org
> Objet : [RFC-v2] Use untested for macscp.exp if no macro information
> generated
> 
> Thanks for your feedback Daniel,
> 
> 
> Here is a new lighter version.
> I finally switch from untested to unsupported,
> which seems closer to reality as it is an
> unsupported feature (of the compiler).
> 
>  Again, the test with  "info source" only works once a source file is
> loaded,
> which is the reason why this test is not put at the very
> start of macscp.exp.
> 
> With that patch,
> doing
> $ make check RUNTESTFLAGS="gdb.base/macscp.exp"
> gives this:
> $ cat gdb.sum
> Test Run By Pierre on Tue Feb  3 15:24:03 2009
> Native configuration is i686-pc-cygwin
> 
>                 === gdb tests ===
> 
> Schedule of variations:
>     unix
> 
> Running target unix
> Running ../../../src/gdb/testsuite/gdb.base/macscp.exp ...
> PASS: gdb.base/macscp.exp: list main
> FAIL: gdb.base/macscp.exp: info macro WHERE after `list main'
> (undefined)
> UNSUPPORTED: gdb.base/macscp.exp: Skipping test because debug
> information
> does n
> ot include macro information.
> 
>                 === gdb Summary ===
> 
> # of expected passes            1
> # of unexpected failures        1
> # of unsupported tests          1
> /usr/local/src/gdbcvs/build/gdb/testsuite/../../gdb/gdb version
> 6.8.50.20090203
> -cvs -nw -nx
> 
> 
> 
> 
> Pierre Muller
> Pascal language support maintainer for GDB
> 
> 
> 
> gdb/testsuite/ChangeLog entry:
> 
> 2009-02-03  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* gdb.base/macscp.exp (info_macro): Return undefined if
> undefined.
> 	(check_macro): Return 1 if undefined.
> 	If first test fails, check if macro debug information is
> available,
> 	and report unsupported test if no macro information is found.
> 
> 
> Index: gdb/testsuite/gdb.base/macscp.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
> retrieving revision 1.19
> diff -u -p -r1.19 macscp.exp
> --- gdb/testsuite/gdb.base/macscp.exp	3 Jan 2009 05:58:03 -0000
> 	1.19
> +++ gdb/testsuite/gdb.base/macscp.exp	3 Feb 2009 14:24:55 -0000
> @@ -152,7 +152,7 @@ proc info_macro {macro} {
>      switch -exact -- $definition {
>          no-macro-info { return no-macro-info }
>          timeout { return timeout }
> -        undefined -
> +        undefined { return undefined }
>          default {
>              if {[llength $location] >= 1} {
>                  return [concat $location [list $definition]]
> @@ -178,6 +178,10 @@ proc check_macro {macro expected where}
>                  xfail "executable includes no macro debugging
> information"
>                  return 1
>              }
> +	    undefined {
> +		fail "info macro $macro $where (undefined)"
> +		return 1
> +	    }
>              timeout {
>                  fail "info macro $macro $where (timeout)"
>              }
> @@ -199,8 +203,28 @@ proc list_and_check_macro {func macro ex
> 
> 
>  if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]}
> {
> -    return 0
> +    global verbose
> +    set macro_support "unknown"
> +    send_gdb "info source\n"
> +    gdb_test_multiple "info source" "Test macro information"  {
> +	-re "Includes preprocessor macro info\..*$gdb_prompt $" {
> +	    set macro_support 1
> +	    verbose "Source has macro information"
> +	}
> +	-re "Does not include preprocessor macro info\..*$gdb_prompt $" {
> +	    set macro_support 0
> +	    verbose "Source has no macro information"
> +	}
> +	default {
> +	    warning "couldn't check macro support (no valid response)."
> +	}
> +    }
> +    if {$macro_support == 0} {
> +	unsupported "Skipping test because debug information does not
> include macro information."
> +	return 0
> +    }
>  }
> +
>  list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before
> macscp2_2}}
>  list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before
> macscp3_2}}
> 


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

* Re: [PING] [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-02-18 22:59             ` [PING] " Pierre Muller
@ 2009-02-19  8:20               ` Tom Tromey
  2009-02-20 10:08                 ` Pierre Muller
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2009-02-19  8:20 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Daniel Jacobowitz', gdb-patches

>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:

Pierre> I didn't get any feedback on this one.

Sorry about that.

Pierre> Should I resend it as a RFA?

No need :)

>> FAIL: gdb.base/macscp.exp: info macro WHERE after `list main'
>> (undefined)

It seems to me that it should be possible to check some macro
expansion without running a "test", and thus not having any FAILs show
up in the log.

Is this too hard?

E.g., I was thinking, send "macro expand FIFTY_SEVEN", and if you
don't get "= 57" back, call untested and return.

Tom


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

* RE: [PING] [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-02-19  8:20               ` Tom Tromey
@ 2009-02-20 10:08                 ` Pierre Muller
  2009-05-11 11:30                   ` PING : " Pierre Muller
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2009-02-20 10:08 UTC (permalink / raw)
  To: tromey; +Cc: 'Daniel Jacobowitz', gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : Thursday, February 19, 2009 2:00 AM
> À : Pierre Muller
> Cc : 'Daniel Jacobowitz'; gdb-patches@sourceware.org
> Objet : Re: [PING] [RFC-v2] Use untested for macscp.exp if no macro
> information generated
> 
> >>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
> 
> Pierre> I didn't get any feedback on this one.
> 
> Sorry about that.
> 
> Pierre> Should I resend it as a RFA?
> 
> No need :)
> 
> >> FAIL: gdb.base/macscp.exp: info macro WHERE after `list main'
> >> (undefined)
> 
> It seems to me that it should be possible to check some macro
> expansion without running a "test", and thus not having any FAILs show
> up in the log.
> 
> Is this too hard?

  The problem is that this does not work
unless you already started the program,
loading it into memory with file is not enough...

  And I didn't want to change the order of the tests
inside macscp.exp (there are a few tests
prior to starting, which I didn't want to touch).

  One solution would be to start the debuggee,
check 'macro expand FIFTY_SEVEN' at that point,
flag as UNTESTED if this fails,
or restart gdb if the macro expand succeeds.

  I thought about that when I first tried to 
handle this, but was afraid that restarting 
gdb once more for every tests done on all machines
just to avoid failures on machines that do
not support macros was not acceptable.

  If you tell me it is OK,
I can try to resubmit a patch
doing so.


Pierre Muller
Pascal language support maintainer for GDB






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

* PING : [PING] [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-02-20 10:08                 ` Pierre Muller
@ 2009-05-11 11:30                   ` Pierre Muller
  2009-05-29 23:40                     ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Muller @ 2009-05-11 11:30 UTC (permalink / raw)
  To: tromey; +Cc: 'Daniel Jacobowitz', gdb-patches

  I would still like to have this accepted
even if it is not optimal...
 In the sense that you still get one failure for
gcc-3 using stabs as default debugging info format
instead of about 500.

  See history, starting here:
http://sourceware.org/ml/gdb-patches/2008-10/msg00282.html
First RFC
http://sourceware.org/ml/gdb-patches/2008-10/msg00323.html
and second version
http://sourceware.org/ml/gdb-patches/2009-02/msg00388.html


Pierre Muller
Pascal language support maintainer for GDB



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pierre Muller
> Envoyé : Friday, February 20, 2009 9:31 AM
> À : tromey@redhat.com
> Cc : 'Daniel Jacobowitz'; gdb-patches@sourceware.org
> Objet : RE: [PING] [RFC-v2] Use untested for macscp.exp if no macro
> information generated
> 
> 
> 
> > -----Message d'origine-----
> > De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> > owner@sourceware.org] De la part de Tom Tromey
> > Envoyé : Thursday, February 19, 2009 2:00 AM
> > À : Pierre Muller
> > Cc : 'Daniel Jacobowitz'; gdb-patches@sourceware.org
> > Objet : Re: [PING] [RFC-v2] Use untested for macscp.exp if no macro
> > information generated
> >
> > >>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
> >
> > Pierre> I didn't get any feedback on this one.
> >
> > Sorry about that.
> >
> > Pierre> Should I resend it as a RFA?
> >
> > No need :)
> >
> > >> FAIL: gdb.base/macscp.exp: info macro WHERE after `list main'
> > >> (undefined)
> >
> > It seems to me that it should be possible to check some macro
> > expansion without running a "test", and thus not having any FAILs
> show
> > up in the log.
> >
> > Is this too hard?
> 
>   The problem is that this does not work
> unless you already started the program,
> loading it into memory with file is not enough...
> 
>   And I didn't want to change the order of the tests
> inside macscp.exp (there are a few tests
> prior to starting, which I didn't want to touch).
> 
>   One solution would be to start the debuggee,
> check 'macro expand FIFTY_SEVEN' at that point,
> flag as UNTESTED if this fails,
> or restart gdb if the macro expand succeeds.
> 
>   I thought about that when I first tried to
> handle this, but was afraid that restarting
> gdb once more for every tests done on all machines
> just to avoid failures on machines that do
> not support macros was not acceptable.
> 
>   If you tell me it is OK,
> I can try to resubmit a patch
> doing so.
> 
> 
> Pierre Muller
> Pascal language support maintainer for GDB
> 
> 
> 



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

* Re: PING : [PING] [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-05-11 11:30                   ` PING : " Pierre Muller
@ 2009-05-29 23:40                     ` Tom Tromey
  2009-05-30  8:04                       ` Pierre Muller
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2009-05-29 23:40 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Daniel Jacobowitz', gdb-patches

>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:

Pierre>   I would still like to have this accepted
Pierre> even if it is not optimal...
Pierre>  In the sense that you still get one failure for
Pierre> gcc-3 using stabs as default debugging info format
Pierre> instead of about 500.

I was intending to try to rewrite this so that we would not see any
FAILs, but I am finally admitting I will not get to this :)
This patch is ok.  Thanks.

Tom


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

* RE: PING : [PING] [RFC-v2] Use untested for macscp.exp if no macro information  generated
  2009-05-29 23:40                     ` Tom Tromey
@ 2009-05-30  8:04                       ` Pierre Muller
  0 siblings, 0 replies; 17+ messages in thread
From: Pierre Muller @ 2009-05-30  8:04 UTC (permalink / raw)
  To: tromey; +Cc: 'Daniel Jacobowitz', gdb-patches

Thanks, Tom.

Patch applied.


Pierre

For the record, here is what I checked in:


ChangeLog entry:

2009-05-30  Pierre Muller  <muller@ics.u-strasbg.fr>

	* gdb.base/macscp.exp (info_macro): Return undefined if undefined.
	(check_macro): Return 1 if undefined.
	If first test fails, check if macro debug information is available,
	and report unsupported test if no macro information is found.


Index: gdb.base/macscp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/macscp.exp,v
retrieving revision 1.21
diff -u -p -r1.21 macscp.exp
--- gdb.base/macscp.exp	29 Apr 2009 07:51:33 -0000	1.21
+++ gdb.base/macscp.exp	30 May 2009 07:54:43 -0000
@@ -155,7 +155,7 @@ proc info_macro {macro} {
     switch -exact -- $definition {
         no-macro-info { return no-macro-info }
         timeout { return timeout }
-        undefined -
+        undefined { return undefined }
         default {
             if {[llength $location] >= 1} {
                 return [concat $location [list $definition]]
@@ -181,6 +181,10 @@ proc check_macro {macro expected where} 
                 xfail "executable includes no macro debugging information"
                 return 1
             }
+	    undefined {
+		fail "info macro $macro $where (undefined)"
+		return 1
+	    }
             timeout {
                 fail "info macro $macro $where (timeout)"
             }
@@ -202,8 +206,28 @@ proc list_and_check_macro {func macro ex
 
 
 if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
-    return 0
+    global verbose
+    set macro_support "unknown"
+    send_gdb "info source\n"
+    gdb_test_multiple "info source" "Test macro information"  {
+	-re "Includes preprocessor macro info\..*$gdb_prompt $" {
+	    set macro_support 1
+	    verbose "Source has macro information"
+	}
+	-re "Does not include preprocessor macro info\..*$gdb_prompt $" {
+	    set macro_support 0
+	    verbose "Source has no macro information"
+	}
+	default {
+	    warning "couldn't check macro support (no valid response)."
+	}
+    }
+    if {$macro_support == 0} {
+	unsupported "Skipping test because debug information does not
include macro information."
+	return 0
+    }
 }
+ 
 list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before
macscp2_2}}
 list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before
macscp3_2}}
 


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

end of thread, other threads:[~2009-05-30  8:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-09 11:37 Results of macscp.exp test on cygwin Pierre Muller
2008-10-09 16:29 ` Tom Tromey
2008-10-09 16:46   ` Pedro Alves
2008-10-09 18:14   ` Daniel Jacobowitz
2008-10-09 20:21     ` Michael Snyder
2008-10-09 22:28       ` Paul Pluzhnikov
2008-10-10 16:04   ` [RFC] " Pierre Muller
2009-01-26  9:13     ` [PING] " Pierre Muller
2009-01-28 13:32       ` [RFC] Use untested for macscp.exp if no macro information generated Pierre Muller
2009-02-01 18:28         ` Daniel Jacobowitz
2009-02-03 14:36           ` [RFC-v2] " Pierre Muller
2009-02-18 22:59             ` [PING] " Pierre Muller
2009-02-19  8:20               ` Tom Tromey
2009-02-20 10:08                 ` Pierre Muller
2009-05-11 11:30                   ` PING : " Pierre Muller
2009-05-29 23:40                     ` Tom Tromey
2009-05-30  8:04                       ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox