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.

CCSV5 cannot locate source files

I am using CCS  Version: 5.3.0.00090  to debug C code that has been loaded externally - there is no CCS project.

I load symbol tables explicitly and this process has worked well in the past, but CCS5 cannot now find any of the source files.

It is looking in the same folder as the symbol table object file (ELF) and is apparently ignoring the information in that file that gives the actual path to the source files (which is not where the object file resides).

I have also been unable to find any way to tell CCS5 where the source files actually are; it would be better if CCS could find the files itself, but doing it manually would be better than nothing.

So my questions are:

1: How, in detail, does CCS5 locate source files?

2: Why is it unable to find source files when the object file is not in the same folder as the sourc e file?

3; Are special compilation options (other than -g) required?

4: How do I explicitly locate source files?

  • Hello:

    Peter Robertson said:
    1: How, in detail, does CCS5 locate source files?

    There are many ways. the main one is to check the information in the debug symbols. The symbols has relative paths to the source files used to build the out file. If it does not find the source files that way, then it will check the source files for the active project. Then it will check the various debug source search paths

    Peter Robertson said:
    2: Why is it unable to find source files when the object file is not in the same folder as the sourc e file?

    It should find them as long as the source file and the generated out file remain in the original locations when the build completed

    Peter Robertson said:
    3; Are special compilation options (other than -g) required?

    -g should be what you need

    Peter Robertson said:
    4: How do I explicitly locate source files?

    There are several options. See slides 48-53 of the CCSv5 tips and tricks:

    http://downloads.ti.com/dsps/dsps_public_sw/sdo_ccstudio/presentations/CCSv5_Tips_&_Tricks.pdf

    Thanks

    ki

  • You write:

    "The symbols has relative paths to the source files used to build the out file".

    The problem with relative paths is that they are completely meaningless

    until you know to what they are relative. Are they relative to the object file

    generated by the compiler, to the relocatable output generated by the

    linker, to the executable generated by the linker from that, or to

    something else entirely?

  • I have now tried the suggestions for debugging without a project in the document you referenced.

    First, the window in CCS with the "No source available for.." message has nothing below the "view disassembly" button; there is no button to do with source.

    Second, even adding the absolute path to the folder containing the source files fails to let CCS find any.

  • Peter Robertson said:

    Are they relative to the object file

    generated by the compiler

    Usually it is relative to the out file generated by the linker. However it can vary depending on your build options, object file format (you are using ELF so it should apply) and which build tools (TI? GCC? etc).

  • Peter Robertson said:

    I have now tried the suggestions for debugging without a project in the document you referenced.

    First, the window in CCS with the "No source available for.." message has nothing below the "view disassembly" button; there is no button to do with source.

    Second, even adding the absolute path to the folder containing the source files fails to let CCS find any.

    You mention that everything worked well in the past but now you have issues with CCSv5. What version of CCS were you last using where it all worked well?

    Since you cannot browse for the source file, it sounds like you don't have all the symbolic debug information generated. It would be best if you could send us the out file so we can analyze it. If this is possible, send me a private message.

    Thanks

    ki

  • As I said, relative paths cause nothing but trouble. You say they are "usually" relative to the linker's out file.

    Usually? So how can anything be found when they are relative to some other unstated point of reference?

    Even ignoring that, I still do not have a clear definition of the true meaning of the relative paths. Here is what I actually have:

    1. /A/W.C is compiled to give /B/X.OBJ
    2. This is linked to give the relocatable output /C/Y.OUT
    3. This is linked to give the executable /D/Z.OUT

    To what are the paths in Z.OUT relative? Where will it actually look for the sources?

  • Peter Robertson said:
    Usually? So how can anything be found when they are relative to some other unstated point of reference?

    I said "usually" because it can depend on the build tools used (TI, GCC or etc), the version of the build tools, and the object file format (COFF, ELF, etc). I know you are using ELF output but otherwise I don't have much more details. I assume you are using TI's compiler since you are using a C6000 device but I don't try to assume anything for usual reasons. Some output always have absolute paths for everything in the debug symbols. Most use relative paths from the location of the *.out file. Some have a relative path to the location of the build directory (the current windows directory when the linker is running).

    What would be most helpful is if you provide the out file. Then we can see exactly what information is in there.

  • I forgot to add that CCS will try relative to the outfile by default. If it can't find the first file (since "usually" is not "always"), then it will ask you to browse to the first file and then try to find the rest relative to that first file. If that fails, it will check the open project and look for the source files in there. Then it will check debug source search paths at the debug session level and workspace level.

  • But relative to which out file?

    The working cases have all been COFF based; my problems started when switching to ELF. The compiler is the CCS5 C6000 C compiler.

    I shall do a few more experiments to confirm or deny a suspicion I have and then try to put something together that demonstrates the problem.

    This may not be straightforward as the build process involves steps that you will not be able to repeat. I shall try to create a pure TI Example..

  • Hi Peter,

    We don't need to be able to build your project. We just need the out file that you are trying to load. We can run our utilities on the out file to extract more detailed information on the debug symbols. That extra information should help us give you definitive answers to you questions and give us some more clues as to why CCS is unable to find any of your source files despite trying the various techniques to point the debugger to them. If you do not wish to post it in this public forum, you can start a private conversation with me to discuss how to hand it off to us privately. To start a conversation, go to my profile (you can just click on my my name) and in the upper right somewhere there should be ab option to start a conversation.

    Thanks

    ki

  • After getting more and more strange behaviour from CCS5, I decided to remove it completely and reinstall. Now CCS can find the source files using objects that previously were failing. It looks like there was something corrupt in my installation.

    Thanks for your help.

  • Hi Ki,

    I also have a similar problem. While I am stepping through code in debugger mode, the program stops stepping and I then get the message No source available for "0x807468" 

  • Seretla Mahlagare said:
    While I am stepping through code in debugger mode, the program stops stepping and I then get the message No source available for "0x807468" 

    Your code jumped to a program location where you have no debug symbols for that address. If that address does not have any valid code, it could be that your code simply "ran into the weeds".

  • Any ideas on how I can solve the problem? I have been battling with it for days now.

    thanks

  • This is something that you will have to debug. I would start with checking to see if that address is valid (is there supposed to be code there)? If not, then how did you get there? You may want to set a hardware watchpoint/breakpoint to halt the target when that location is reached. I don't know what device you are using but if you have some PC trace capability, you can trace your program execution and see how the PC jumped to that location.

    If that address is valid, what code is there? Is it code from a library that was linked in but you don't have symbols and source for? Is the code at that address a valid instruction?

    See here for some more tips:

    http://processors.wiki.ti.com/index.php/Debug_Handbook_for_CCS#Advanced_Debugging

    Good luck!

    ki