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.

Log_info0 requires full path to the source file being encoded in the constant strings section

Guru**** 467511 points


Hello,

While investing this thread on the CCS forums:

http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/317962/1120921.aspx

It was determined that the differences are attributed to the full path to the source file being encoded in the constant strings section (the two projects reference some identical copies of source files in different locations). This is because of a Log_info0 call which uses a string that is the full path name of the current file. It includes __FILE__ in it somewhere. So changing the location of the source file will impact the actual generated code if Log_info0 is called. Is this known behavior and if so, is there a way to avoid this dependency?

Thanks

ki

  • Hello,

    I have the same problem and that meens that i cannot use this wonderful tool of Log_info???

    we are several developers that working under source control - how could we avoid this problem and work with Log_info ???

    Please answer A.S.A.P

    Thanks, Merav.

  • Hi Ki, Merav,

    __FILE__ expansion to file's absolute path is controlled by the C standard and we have little control over this behavior. That said, XDC tools defines a macro called xdc_FILE (that maps to __FILE__ by default) and the value assigned to this macro is used by Log_info() to log the file path. So you can change xdc_FILE definition to achieve what you want.

    You can override xdc_FILE macro in either your C source file or by passing "-Dxdc_FILE=" on the compile line and make it equal the file's name instead of __FILE__. This way the object file has a string with just the file name instead of the full path to the file and the object files should match.

    Here's a wiki page that explains xdc_FILE in more detail: http://rtsc.eclipse.org/docs-tip/Integrating_RTSC_Modules#Controlling_File_Name_Strings

    Please note that if you plan to define xdc_FILE in the C source file, it should be defined before any xdc related header file is included.

    Best,

    Ashish

  • Thanks Ashish!