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

Jason Molenda jmolenda@apple.com
Mon Feb 24 23:34:00 GMT 2003


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



More information about the Gdb-patches mailing list