public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Expanding and debugging macros
@ 2020-06-27 11:23 Jeffrey Walton
  2020-06-27 11:47 ` Alexander Monakov
  2020-06-27 17:12 ` Edward Diener
  0 siblings, 2 replies; 3+ messages in thread
From: Jeffrey Walton @ 2020-06-27 11:23 UTC (permalink / raw)
  To: gcc-help

Hi Everyone,

I'm trying to debug a c function that is mostly a massive collection of macros.

I changed the makefile recipe to preprocess the source trying to
produce something I can step:

#blake2b:    blake2b.c
#        $(CC) blake2b.c -o $@ $(CFLAGS) $(POWER8_CFLAG) -DBLAKE2B_SELFTEST

blake2b:    blake2b.c
        $(CC) -E blake2b.c -o blake2b.E $(CFLAGS) $(POWER8_CFLAG)
-DBLAKE2B_SELFTEST
        $(CC) -x c blake2b.E -o $@ $(CFLAGS) $(POWER8_CFLAG) -DBLAKE2B_SELFTEST

But GDB is not stepping it:

238      ROUND( 0 );
(gdb) s
239      ROUND( 1 );
(gdb) s
240      ROUND( 2 );
(gdb) q

I also switched to -save-temps with the same result - no stepping.

blake2b:    blake2b.c
        $(CC) -E blake2b.c -o blake2b.i $(CFLAGS) -save-temps
$(POWER8_CFLAG) -DBLAKE2B_SELFTEST
        $(CC) blake2b.i -o $@ $(CFLAGS) $(POWER8_CFLAG) -DBLAKE2B_SELFTEST

Is there a way to achieve this using GCC without changing the source files?

Thanks in advance.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-27 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-27 11:23 Expanding and debugging macros Jeffrey Walton
2020-06-27 11:47 ` Alexander Monakov
2020-06-27 17:12 ` Edward Diener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).