On 06/28/2018 11:49 AM, Tom de Vries wrote: > Hi, > > I played around with pr45882.c and ran into FAILs. It took me a while to > realize that the FAILs where due to the gdb-test (a dg-final action) using > absolute line numbers, and me adding lines before the gdb-test lines. > > I've written this patch, which factors out the handling of relative line > numbers as well as line number variables from process-message, and reuses the > functionality in gdb-test. > > This enables the line number variables functionality in gdb-test. [ There's > one quirk: line number variables have a define-before-use semantics (with > matching used-before-defined error) but in the test-case the use in gdb-test > preceeds the definition in gdb-line. This doesn't cause errors, because > the dg-final actions are executed after the definition has taken effect. ] > > [ Relative line numbers still don't work in gdb-test, but that's due to an > orthogonal issue: gdb-test is a dg-final action, and while dg-final receives > the line number on which it occurred as it's first argument, it doesn't pass > on this line number to the argument list of the action. I'll submit a > follow-on rfc patch for this. ] > > Tested pr45882.c. Tested one test-case with relative line numbers, and > one with line number variables to make sure I didn't break process-message. > > OK for trunk if bootstrap and reg-test succeeds? > > Thanks, > - Tom > > [testsuite/guality] Use line number vars in gdb-test > > 2018-06-28 Tom de Vries <tdevr...@suse.de> > > * gcc.dg/guality/pr45882.c (foo): Add line number var for breakpoint > line, and use it. > * lib/gcc-dg.exp (get-absolute-line): Factor out of ... > (process-message): ... here. > * lib/gcc-gdb-test.exp (gdb-test): Use get-absolute-line. I prefer the relative line numbers, but either approach is fine with me. Your call.
jeff