My project compiled with -g option instead of -g3, which means that I can’t expand macros in gdb. I want to add the -g3 flag to GCC, but I don’t want to modify the makefile, I just want to add this flag via the Make command line.
How can I do it?
That depends on what the Makefile does/how it was written. It might not be possible.
If your Makefile is reasonably “standard”, then this should work:
If it’s for C++: