The title says it pretty nicely. I have a huge project that uses Makefile. How do I do a project-wide debug dumps (say, -fdump-tree-gimple) with GCC?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You must pass
-fdump-tree-gimple(actually put any pass-name instead ofgimple, or evenallto dump all tree passes) to compilation string for every compiler execution (i.e. every time, you are calling gcc on source files or with-coption). Dump in formfilename.c.XXX.gimplefor any source file name will appear (XXX is a pass number like 003, depends on gcc version) in a working directory (often it is build folder). Also you may want to specify-dumpdirto collect all dumps in a single dump directory, this may be handy to avoid mess.How will you do it in you makefile — up to you. You may add it to
$CFLAGS(most common solution, because dumping is a part of compilation flags), or create special variable and pass it around, or hard-code it inside makefile.If you are building your project with lto, you must pass those flag(s) also on second link stage (i.e. add to LDFLAGS or so).