This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Getting CCSV4 listing files



I am still new to CCSV4 (but have used other environments
for 30+ years) so I may have a problem with terminology. I
want:
  - The compiler to produce a compiler listing file,
  - The linker to produce a linker listing file.

In my version of English, a compiler, an assembler, and a
linker are all separate applications when invoked from the
command line. It appears the TI development tool embedded in
CCSV4 is a single, *.* program called cl2000 that changes
function by inclusion of command line options.

By 'compiler listing' I mean a processed version of the
source file, showing line numbers, control structure nesting
level (i.e. "How many pairs of '{' '}' are we inside of?");
optional display of all #included files, expansion of all
pre-processor macros, and assembly language statements
associated with each compiled line of source.

By 'linker listing' I mean a list of all local & global
variable names, functions, and their final addresses in
memory; optional cross-reference table showing which
extern-enabled objects were referenced in another module,
and a call structure diagram showing which functions called
other functions, down as many levels as necessary.

By 'file' I mean a Windows ASCII file, consisting of strings
approximating the width of my screen and terminated by CR/LF
pairs, stored in my disk drive that I can bring up inside my
editor, pass through awk or Perl scripts to extract critical
data, or just print out on paper if I feel like it.

I have downloaded and 'parsed' SPRU514C (won't say I have
read it from cover to cover, but did my best) but I can't
find anything resembling the functionality described above.

To me this is like being ordered to paint a daVinci-quality
masterpiece while blindfolded.  Why?

  • Gary Lynch said:

    I want:
      - The compiler to produce a compiler listing file,
      - The linker to produce a linker listing file.

    You can configure the build environment to generate both of these items.

     

    Gary Lynch said:

    In my version of English, a compiler, an assembler, and a
    linker are all separate applications when invoked from the
    command line.

    The assembler and compiler/linker are distinct executables running under the hood of the CCS Integrated Development Environment.

    Gary Lynch said:

    It appears the TI development tool embedded in
    CCSV4 is a single, *.* program called cl2000 that changes
    function by inclusion of command line options.

    As you mentioned, the compiler and linker are included in 1 executable.  However, there are command line options that instruct the cl2000 to perform a compile only operation and to perform a link only operation.

    Gary Lynch said:

    By 'compiler listing' I mean a processed version of the
    source file, showing line numbers, control structure nesting
    level (i.e. "How many pairs of '{' '}' are we inside of?");
    optional display of all #included files, expansion of all
    pre-processor macros, and assembly language statements
    associated with each compiled line of source.

    In CCS, you can configure the compiler to generate a listing file via the Project Build options menu.  There is a compiler tab that allows you to enable this.

    Gary Lynch said:

    By 'linker listing' I mean a list of all local & global
    variable names, functions, and their final addresses in
    memory; optional cross-reference table showing which
    extern-enabled objects were referenced in another module,
    and a call structure diagram showing which functions called
    other functions, down as many levels as necessary.

    In a similar fashion, there is a linker tab option in the Project build options menu.

    Gary Lynch said:

    By 'file' I mean a Windows ASCII file, consisting of strings
    approximating the width of my screen and terminated by CR/LF
    pairs, stored in my disk drive that I can bring up inside my
    editor, pass through awk or Perl scripts to extract critical
    data, or just print out on paper if I feel like it.

    We have the same definition.  vim works great on the .c and .h files.

  • The "compiler listing" you seek is probably the "listing file" described in the other thread you recently replied in:  use -s, -ss, or -os, and -k, and -al (in long form, --asm_listing and --c_src_interlist or --src_interlist probably combine for what you want).  As you pointed out in the other thread, it may be difficult to relate the asm instructions to the source lines if optimisation is on.  The --preproc_only option may also be useful;  it produces a file showing the preprocessed source.

    The "linker listing" is probably closest to the "map file" produced by the linking option --map_file.  There is also a --cross_reference option.  I do not know if any of those automatically produce a call graph, but the cg_xml package may include a script that does.

    In spru514c, see sections 2.3.9, 2.3.1, and 4.2.  The terms "listing file" and "interlist utility" appear in the index.  I can't find the number of the Assembly Language and Tools manual that would contain more detail, but those options are much the same across TI tools;  spnu118i (for ARM) describes assembly listings in section 3.11, cross references in chapter 9, absolute listings (another form which might prove useful to you) in chapter 8.

    The term "file" appears to have a similar definition in our version of English.

  • I'm going to narrow my focus to just "compiler listing". 

    On Thursday, December 30, 2010 4:53 PM; pf (et al) wrote:
    >
    > The "compiler listing" you seek is probably the "listing
    > file" described in the other thread you recently replied in:
    > use -s, -ss, or -os, and -k, and -al (in long form,
    > --asm_listing and --c_src_interlist or --src_interlist
    > probably combine for what you want).
    >
    I looked up those options (some of which I have already
    tried):
      -s    Interlists optimizer comments (if available) and
            assembly source statements; otherwise interlists C and
            assembly source statements
      -ss   Interlists C source and assembly statements
      -os   Interlists optimizer comments with assembly statements
      -k    Keeps the assembly language (.asm) file
      -al   Generates an assembly listing file

    Looking at the assembly language of a C statement, while
    useful, was not the goal of this post. I phrased my question
    very carefully because as far as I am concerned the TI
    compiler authors re-defined the word "listing" away from the
    meaning I have used for the last 30 years.  As I originally
    wrote, I want a listing that:
      1 Shows line numbers,
      2 Shows control structure nesting level,
      3 Optionally displays contents of #included files,
      4 Optionally shows expansion of pre-processor macros.

    I neglected to mention my most important criterion, which
    is:
      5 Shows error type next to associated source line.

    Here are a couple of snippets from true listing files from
    another compiler vendor:

     367   1        for(i=0; i<NUM_CYC_CLK; i++) {   /* Event  */
     368   2          if(evtClk.cycle[i] < 65535)    /* cycle  */
     369   2            evtClk.cycle[i]++;           /* clocks */
    *** ERROR C187 IN LINE 369 OF CLOCKDRIVER.C: not an lvalue
     370   2        }
     · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
     243   2          if(!run) {
    *** ERROR C202 IN LINE 243 OF WALKIN.C: 'run': undefined identifier
     244   3            state = RECT_OFF;
    *** ERROR C202 IN LINE 244 OF WALKIN.C: 'state': undefined identifier
     245   3            state2Led(RECT_OFF, 0);
    *** ERROR C202 IN LINE 245 OF WALKIN.C: 'RECT_OFF': undefined identifier
     246   3            return;
     247   3          }

    The first number on the left side is the line number, the
    second is the control structure nesting depth. Errors are
    tied to a specific line and include a terse explanation and
    an error code that I can look up in the manual, should I
    need a better explanation.

    I have never been able to get CCSV4 to do anything close to
    this, and it is really hard to explain to this body with the
    word re-defined to an unrelated concept.
    ============================================================
    Gary Lynch        printf("lynchg%cstacoenergy%ccom", 64, 46)
    ============================================================

  • Consider the --gen_acp_raw option discussed in the C2000 compiler book.

    Thanks and regards,

    -George

  • On Thursday, February 10, 2011 12:25 PM; Georgem wrote:
    >
    > Consider the --gen_acp_raw option discussed in the C2000 compiler book.
    >

    By George, you've got it! (Sorry, I couldn't help myself.)
                                                             :-)

    I used this option to re-compile the fileset that was
    giving me fits at the time, checked the output against
    my spec for 'compiler listing', and found:
    - line numbers,
    - control structure nesting level (i.e. "How many pairs of
      '{' '}' are we inside of?");
    + optional display of all #included files,
    + expansion of all pre-processor macros, and
    - assembly language statements associated with each
      compiled line of source.

    In this case, 2 out of 5 is the first ray of hope I've
    seen since I started banging my head against this IDE.

    I have read about a different compiler output file that
    shows associated assembly language, so that leaves only
    2 items.

    Thanks, George.

  • May be, this will be useful for you:

    C/C++ Perspective: Active project -> Right click -> Properties,

    then

    Tab "Tool Settings" 

    Tool chain settings

    CXXXXX Compiler

    Directory Specifire

    In input box "Listing/xref file directory (default is .obj dir) (--list_directory, -ff)" type, for example, "C:\TIWorkSpace\Hello\lst".

    In C:\TIWorkSpace\Hello\lst you will find main.lst.

     

    VKM