Re: Show insn-preds.c instead of predicates.md during debug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maxim Blinov via Gcc-help <gcc-help@xxxxxxxxxxx> writes:
> Hi everyone,
>
> I am currently in the process of debugging some RTL-emitting code.
> Specifically, I'm implementing an md template to get picked up by
> emit_conditional_cmov. Now that is all fine and dandy, however during
> debug I eventually single-step to the following function:
>
> insn_operand_matches (enum insn_code icode, unsigned int opno, rtx operand)
> {
>   return (!insn_data[(int) icode].operand[opno].predicate
>           || (insn_data[(int) icode].operand[opno].predicate
>               (operand, insn_data[(int) icode].operand[opno].mode)));
> }
>
> When we make the call into the predicate, GDB switches the view into
> the corresponding machine description file. This is really not what I
> want - I just want to step through the honest-to-god C code in the
> generated insn-preds.c file.
>
> Is there a switch one can give to GDB to stop being "too clever"?

Unfortunately the best way at present to do that is to sed out the
"#line"s from insn-preds.c and then rerun "make".  E.g.:

  sed -i '/^#line/d' insn-preds.c

The reason for adding the #lines is that it gives better line number
information for diagnostics, if there's a warning or error in the
.md C++ code.

At the moment we don't emit #lines to switch back to insn-preds.c
because there's no code to track what the correct line number would be.
Another reason used to be that, for files like insn-recog.c, we'd need
line numbers greater than C guaranteed, but that should no longer be a
problem now that we're using modern(ish) C++.

Thanks,
Richard




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux