Re: [PATCH 1/2] Fix reverse stepping multiple contiguous PC ranges over the line table.

Carl Love via Gdb-patches
2023-06-22T16:53:38Z

Simon:

On Mon, 2023-06-19 at 13:11 -0400, Simon Marchi wrote:
> > --- a/gdb/testsuite/lib/gdb.exp
> > +++ b/gdb/testsuite/lib/gdb.exp
> > @@ -4794,6 +4794,8 @@ proc quote_for_host { args } {
> > # debug information
> > # - text_segment=addr: Tell the linker to place the text
> > segment at ADDR.
> > # - build-id: Ensure the final binary includes a build-id.
> > +# - no-column-info: Disable generation of column table
> > information.
> > +# - column-info: Enable generation of column table information.
> > #
> > # And here are some of the not too obscure options understood by
> > DejaGnu that
> > # influence the compilation:
> > @@ -5003,6 +5005,34 @@ proc gdb_compile {source dest type options}
> > {
> > } else {
> > error "Don't know how to handle text_segment
> > option."
> > }
> > + } elseif { $opt == "column-info" } {
> > + if {[test_compiler_info {gcc-*}]} {
> > + if {[test_compiler_info {gcc-[1-6]-*}]} {
> > + error "gdb_compile option no-column-info not
> > supported."
>
> I think this path should return the equivalent of "failed to
> compile",
> instead of throwing an error. Control will go back to the test,
> which
> will generally skip the portion of the test that requires that
> binary.

Not entirely sure how to accomplish what you are looking for.

I change:
error "gdb_compile option no-column-info not supported."
to
set result "option no-column-info not supported."
clone_output "gdb compile failed, $result"
return 1

When I force the if {[test_compiler_info...]} tp be true to test this,
I get:

get_compiler_info: gcc-12-2-1
gdb compile failed, option no-column-info not supported.
UNTESTED: gdb.reverse/func-map-to-same-line.exp:
with_column_info=yes: failed t\
o prepare
testcase /home/carll/GDB/build-reverse-multiple-
contiguous/gdb/testsuite/../../\
../binutils-gdb-reverse-multiple-
contiguous/gdb/testsuite/gdb.reverse/func-map-\
to-same-line.exp completed in 0 seconds

=== gdb Summary ===

# of untested testcases 1

The test case doesn't have any part of the test that doesn't require
compiling so it is not clear if that would work with this fix. Anyway,
wanted to run that by you to see if this is an appropriate fix? I am
really not sure about it. Thanks.

Carl