Expanding and debugging macros

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

 



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.



[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