On Thu, 27 Aug 2020, Pip Cet via Gcc wrote:
> I may be missing an obvious workaround, but it seems we currently emit
> a #line directive when including lines from machine description files
> in C files, but never emit a second directive when switching back to
> the generated C file. This makes stepping through the backend in gdb
> somewhat painful, because gdb thinks it should display lines from the
> md file even after leaving the included fragment.
>
> The attached patch is a proof of concept which unconditionally emits a
> line containing "/* #unline */" after such fragments, and runs all
> generated C files through a trivial filter which replaces those lines
> by #line directives pointing back to the original file. It appears to
> work.

Thanks for taking on this!

I hope you and/or Richard Sandiford get this wart fixed.  I
confess I usually hack read-md.c to not emit the #line directive
whenever I actually need to step into the md-generated code, and
though it's crossed my mind I never got around to try emitting a
"closing" #line directive. :-/

IMHO stepping into the .md really isn't helpful.  Even a pattern
name in a comment in the generated code would be better.

brgds, H-P

Reply via email to