Header file debug

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

I would like to debug a C-header-file.
The diagnostic macros #error and #warning accept and output strings only.

Is there a way to display the value of expanded macros during compilation process?

Thanks,
HJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Run cpp(1), the C preprocessor on the file manually?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would be avr-cpp. But I think some predefined macros will not be set that way.

Also passing the -E option to avr-gcc will list the preprocessed source code, but not compile it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the feedback.

I'am aware of option -E, but was looking for an easier way.

Best regards,
HJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you use an Mfile generated Makefile then just use "make fred.i" for a file called fred.c and you'll end up with a copy of the preprocessed file with all the .h files included and macros expanded.

Cliff