How to output the compiled assembly?

Sysprogs forums Forums VisualGDB How to output the compiled assembly?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8475
    CurtisHx
    Participant

    How I list the assembly from the compiler?  I tried adding the -S option to the CCFAGS settings under VisualGDB Project Properties-> Makefile settings, but only the object files wind up in the Debug folder.

    #8476
    support
    Keymaster

    The easiest way to do that is to copy the build command line from the Output window, replace “-c” with “-S” and “-o <object.o>” with “-o <output.S>” and run it manually from the Command Line Prompt. Then the assembly output will be saved to <output.S>.

    #8482
    CurtisHx
    Participant

    Is there a better way to do it?  I would like to configure the project to output the assembly as well as object files for all of the compiled files during a build.

    #8484
    support
    Keymaster

    Hi,

    Yes, you can edit the Makefile as follows:

    #VisualGDB: FileSpecificTemplates        #<--- VisualGDB will use the following lines to define rules for source files in subdirectories
    $(BINARYDIR)/%.o : %.cpp $(all_make_files) |$(BINARYDIR)
        $(CXX) $(CXXFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
        $(CXX) $(CXXFLAGS) -S $< -o $(@:.o=.S)

    Then modify the SOURCEFILES line so that VisualGDB regenerates the file-specific templates. This should start generating a .S file for each source file.

    #8486
    CurtisHx
    Participant

    Nice.  That’s exactly what I was looking for.  I’m still fairly new to gcc and makefiles.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.