Here is the source file fragment:
#define TEST 34
#define PRINT_CONCAT(a, b) \
printf("%d\n", a##b)
Compiling with GCC and linking this source file into a binary with flags -ggdb3 -O3 and running the app with gdb shows up the following behavior:
(gdb) p TEST
$3 = 34
(gdb) p PRINT_CONCAT
No symbol "PRINT_CONCAT" in current context.
Is there a way to make gdb expand function macros in any way?
p PRINT_CONCATwould actually print, given thatPRINT_CONCATis a function-like macro?gcc -Eto do the preprocessing.gcc -Emight be very noisy and it's usually required to extractcompile_commandfragment for the specific file to run.