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

Simon Marchi via Gdb-patches
2023-05-11T17:29:04Z

> I was going to suggest something similar in an earlier revision, but
> when I tried to look for how to control it in clang, I couldn't see it
> at all, that's why I thought it was OK to restrict it to gcc only. Can
> clang (or other compilers for that matter) emit this information?clang does, yes, with the same flags as gcc:

https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-gcolumn-info

> Also, how would gdb_compile handle if the current compiler doesn't
> support a given option, but the others do? Should it loudly fail, or
> silently ignore the "broken" option? If the second, I guess there is
> no harm in allowing clang to run these tests and testing the same
> scenario twice

I'm not sure, you'd have to look at how other options are handled.

But intuitively, if gdb_compile isn't able to fulfill your request, then
it should fail. For instance, if you used no-column-info with gcc 6
(which doesn't support column info at all), gdb_compile should succeed,
even if there isn't an option to disable column info with that compiler.
If you used column-info with gcc 6, gdb_compile would fail.

If there exists some compiler that always emits column info, with no
option to turn it off, then column-info would work with that compiler,
but no-column-info wouldn't.

To start with, I think it's fine to make column-info and no-column-info
map to -gcolumn-info and -gno-column-info. And then, you can probably
teach gdb_compile about older gccs and older clangs that don't support
column info.

If people test with other compilers that don't support -gcolumn-info or
-gno-column-info, the test won't compile. They can then contribute
support for the column-info / no-column-info options for that compiler.

Simon