regno_reg_rtx and related macros

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sat Dec 18 17:29:00 GMT 1999


    That's a difference.  Dare I suggest fixing GDB?

    I see this as a deficiency in the debugger, 

How?  The debugger never sees the macros and it would be unrealistic to
have it to macro expansions even if it did.

    and I don't think it's worth *in this case* obfuscating the code in
    GCC.

The issue is what "obfuscating" means.  I certainly agree the sources should
be clean in this regard.  However, they were before this change!

  o Adding .gdbinit improvements.
  o Adding functions to use in the debugger.

Yes, this is certainly one approach, but every time another level of
macros is added, it makes debugging the compiler harder, even with this.
That's not to say it shouldn't be done, but, in my opinion, it's a real
downside to making such changes and needs to be considered when such changes
are made.

Even with these function, you have to know to call them and what they are.
That serves to *increase* the amount of information you need to know in
order to work in GCC and that amount is already quite high.

The point is that if I see the expression:

	regno_reg_rtx[i] != 0

and I'm in the debugger and want to see what the value is, the most natural
thing to do is

	print regno_reg_rtx[i]

That doesn't work and there's no way to get it to work.

Certainly we can set things up so that

	p i
	prif

prints the register info, but, as I said, that's yet one more nonobvious
thing for someone learning GCC to have to figure out.


More information about the Gcc mailing list