This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pending/971: RFA: Check that `Local' is not in scope when it shouldn't be


>Number:         971
>Category:       pending
>Synopsis:       RFA: Check that `Local' is not in scope when it shouldn't be
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Thu Jan 30 03:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 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
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]