This is the mail archive of the gdb-patches@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]

Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES



On Monday, February 24, 2003, at 01:46 PM, Stephane Carrez wrote:


It's not good because marker4() is defined at 2 different lines.

If we use gdb_get_line_number() it will always find the first match which is at 46

and the test will fail for targets that don't compile their tests with -DPROTOTYPES.

Another alternative is to grab the line number when the breakpoint is set, and compare against that. It does mean that gdb could have the line number woefully incorrect, but at least gdb has to be consistently incorrect. e.g. something like


   send_gdb "break marker4\n"
   gdb_expect {
     -re "Breakpoint.*at.* file .*$srcfile, line ($decimal).*" {
       set marker4_lineno $expect_out(1,string)
     }
[...]
   }

Or drop the PROTOTYPES-is-undefined case altogether. I have no idea if there are cross-compilers in use that don't support prototypes, though..

J


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