Internal macros as fns for debug (was: Re: regno_reg_rtx and relatedmacros)

Hans-Peter Nilsson hp@bitrange.com
Tue Dec 21 12:01:00 GMT 1999


Geoff Keating wrote:

> if we have a macro
> 
> #define FOO(a,b,c) some_huge_computation + a + b + c
> 
> then, in a separate source file, do
> 
> int (FOO) (int a, int b, int c) { return FOO(a,b,c); }
> 
> this way you can write
> 
> print FOO(aa,bb,cc)
> 
> in the debugger.
> 
> This would be particularly useful for all those RTX accessor macros so
> you don't have to remember which rtunion field you should be looking
> at, and can copy-and-paste from source files into the debugger.

Have you (or anybody else) started doing this, at least for
rtl-accessors?

If not, I'll do it right away.  An exercise if nothing else.

Sketches:
- Prototypes in rtl.h
- Functions in (new) internal-debug.c (or keep them in rtl.c?)
- Functions and declaration guarded by autoconf macro
  (HAVE_MACRONAME_AS_IDENTIFIER) for the benefit of bootstrapping
  from broken preprocessors that don't like the same token as macro
  and identifier token - if there are any.

Anyway, Merry Christmas and Happy Holidays to you all.
brgds, H-P



More information about the Gcc mailing list