Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Jim Blandy <jimb@redhat.com>] RFA: Check that `Local' is not in scope when it shouldn't be
@ 2002-12-20 10:56 Jim Blandy
  2002-12-20 11:19 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jim Blandy @ 2002-12-20 10:56 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 33 bytes --]


Ping on this test suite patch.


[-- Attachment #2: Type: message/rfc822, Size: 4823 bytes --]

From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: Check that `Local' is not in scope when it shouldn't be
Date: 14 Nov 2002 15:11:15 -0500
Message-ID: <vt2wunfoqsc.fsf@zenia.red-bean.com>


See http://sources.redhat.com/ml/gdb/2002-11/msg00153.html for the
problem being addressed.  I've filed a new PR for the problem this
patch uncovers, and used its number in the kfail for the new test
here.

gdb/testsuite/ChangeLog:
2002-11-14  Jim Blandy  <jimb@redhat.com>

	* local.exp: Don't expect Local to be in scope in main; it's local
	to foobar.  Check for it there, and check that it's not present in
	main.
	* local.cc (marker2): New function.
	(foobar): Call marker1.
	(main): Call marker2 instead of marker1.

Index: gdb/testsuite/gdb.c++/local.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/local.cc,v
retrieving revision 1.2
diff -c -r1.2 local.cc
*** gdb/testsuite/gdb.c++/local.cc	10 Apr 2002 03:52:21 -0000	1.2
--- gdb/testsuite/gdb.c++/local.cc	14 Nov 2002 20:20:27 -0000
***************
*** 4,9 ****
--- 4,12 ----
  { 
  }
  
+ void marker2 (void)
+ {
+ }
    
  int foobar (int x)
  {
***************
*** 20,25 ****
--- 23,30 ----
    static Local l1;
    char  c;
  
+   marker1 ();
+ 
    l.loc1 = 23;
  
    c = l.loc_foo('x');
***************
*** 56,61 ****
  
     il.ilc = 'b';
     il.ip = &c;
!    marker1();
   }
  }
--- 61,66 ----
  
     il.ilc = 'b';
     il.ip = &c;
!    marker2();
   }
  }
Index: gdb/testsuite/gdb.c++/local.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/local.exp,v
retrieving revision 1.9
diff -c -r1.9 local.exp
*** gdb/testsuite/gdb.c++/local.exp	27 May 2002 18:00:14 -0000	1.9
--- gdb/testsuite/gdb.c++/local.exp	14 Nov 2002 20:20:28 -0000
***************
*** 67,73 ****
      continue
  }
  
! gdb_test "up" ".*main.*" "up from marker1"
  
  # Local classes in g++ get names like "main.1::InnerLocal", just like local
  # static variables.  Some targets use "___" instead of ".".
--- 67,73 ----
      continue
  }
  
! gdb_test "up" ".*foobar.*" "up from marker1"
  
  # Local classes in g++ get names like "main.1::InnerLocal", just like local
  # static variables.  Some targets use "___" instead of ".".
***************
*** 110,115 ****
--- 110,128 ----
    -re ".*$gdb_prompt $"   {  fail "ptype Local" }
    timeout             { fail "(timeout) ptype Local" }
  }
+ 
+ if ![runto 'marker2'] then {
+     perror "couldn't run to marker2"
+     continue
+ }
+ 
+ gdb_test "up" ".*main.*" "up from marker2"
+ 
+ # Make sure that `Local' isn't in scope here; it's local to foobar.
+ # setup_kfail "gdb/825"
+ gdb_test "ptype Local" "No symbol \"Local\" in current context.*" \
+          "Local out of scope (gdb/825)"
+ 
  
  # DTS CLLbs14316 and CLLbs17058
  # coulter - I added a clause for HP's aCC compiler.  We print out the type



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Jim Blandy <jimb@redhat.com>] RFA: Check that `Local' is not in scope when it shouldn't be
@ 2002-12-20 21:12 Michael Elizabeth Chastain
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-20 21:12 UTC (permalink / raw)
  To: carlton, drow; +Cc: fnasser, gdb-patches, jimb

David C writes:
> Right!  And send C++ testsuite patches to Michael, too: he's able to
> review them again these days as well.  So hopefully one or the other
> of us should be able to get at such patches quickly.

I'll be wearing my C++ test suite maintainer hat on Sunday I think.

Michael C


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Jim Blandy <jimb@redhat.com>] RFA: Check that `Local' is not in scope when it shouldn't be
@ 2002-12-23 22:51 Michael Elizabeth Chastain
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-23 22:51 UTC (permalink / raw)
  To: fnasser, jimb; +Cc: ac131313, gdb-patches

Regarding this patch:

  2002-11-14  Jim Blandy  <jimb@redhat.com>

	* local.exp: Don't expect Local to be in scope in main; it's local
	to foobar.  Check for it there, and check that it's not present in
	main.
	* local.cc (marker2): New function.
	(foobar): Call marker1.
	(main): Call marker2 instead of marker1.

The first part of this patch, "Don't expect Local to be in scope in main;
it's local to foobar.", is approved.  I agree with your analysis and most
of your solution.  I don't like the second call to "runto 'marker2'",
because "runto" restarts gdb needlessly.  I think it's better to do:

  gdb_test "break marker2" ...
  gdb_test "continue" "Break.* marker2 ... at ..."

But the test works correctly as you wrote it, and the existing code 
doesn't, so I approve it and someone can rewrite the second "runto"
after you commit this.

The second part, "... check that it's not present in main",
is not approved.  You wrote the KFAIL like this:

  # setup_kfail "gdb/825"
  gdb_test "ptype Local" "No symbol \"Local\" in current context.*" \
    "Local out of scope (gdb/825)"

There is a coding style issue here.  My vision is that KFAIL's are always
a response to specific known bad output from gdb, like this:

  send_gdb "ptype Local\n"
  gdb_expect {
    -re "No symbol \"Local in current context.\r\n$gdb_prompt $" {
      pass "ptype Local"
    }
    -re "... big regular expression that matches the correct declaration of Local from the wrong scope ..." {
      # comment here about which configurations we expect this for
      kfail "gdb/825" "ptype Local"
    }
    -re ".*$gdb_prompt $" {
      fail "ptype Local"
    }
    timeout {
      fail "ptype Local (timeout)"
    }
  }

This way, the test can still generate FAIL if gdb starts acting in a
new unknown way.  The first test actually does this; it went from FAIL
(gdb/483) to an unmarked FAIL, which indicated that there was a problem
(which turned out to be in the test script itself).

I think this issue needs some discussion and then a decision from
FernandoN or AndrewC so I'd like to hold off on the second test in
this patch while we resolve this.

(I spent too much time on this patch because I started doing my own
update of Local.exp with my style of KFAIL's everywhere.  Then I decided
it's better just to respond to JimB and work on an all-updated local.exp
later.)

Michael C


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Jim Blandy <jimb@redhat.com>] RFA: Check that `Local' is not in scope when it shouldn't be
@ 2003-02-05  6:23 Michael Elizabeth Chastain
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-05  6:23 UTC (permalink / raw)
  To: gdb-patches, jimb

Looks okay to me too, I'll be catching it in the next spin.

JimB> I couldn't figure out, though, why folks were advising me to use
JimB> setup_kfail with a pattern that always matches, instead of simply
JimB> calling kfail directly.  So I just used kfail.

Your intuition is proper.

I wrote the 'setup_kfail' comments before kfail was implemented,
and before we'd figured out our idioms for it.  It turns out that we
will have lots of 'kfail' and very few 'setup_kfail'.  I think the
remaining xfail's should be that way too (after we kill all the bogus
ones).

Michael C


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

end of thread, other threads:[~2003-02-05  6:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20 10:56 [Jim Blandy <jimb@redhat.com>] RFA: Check that `Local' is not in scope when it shouldn't be Jim Blandy
2002-12-20 11:19 ` Daniel Jacobowitz
2002-12-20 12:05   ` David Carlton
2002-12-20 12:01 ` David Carlton
2002-12-20 12:18   ` David Carlton
2003-02-04 22:02 ` Jim Blandy
2003-02-04 22:16   ` David Carlton
2003-02-05  5:49     ` Jim Blandy
2002-12-20 21:12 Michael Elizabeth Chastain
2002-12-23 22:51 Michael Elizabeth Chastain
2003-02-05  6:23 Michael Elizabeth Chastain

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