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.

Cannot debug assembler code with CCS/GCC toolchain

Other Parts Discussed in Thread: HALCOGEN

I am developing a project on RM48x which consists of both C files and assembler files using CCS/GCC toolchain.

I can debug the C code, but there doesnt seem to be any debug info for the assembler parts of my code.

Here is the summary of the flags passed to GCC:

 -g -gdwarf-4 -Wall -mcpu=cortex-r4 -gdwarf-3 -mlittle-endian -r -mfpu=vfpv3-d16 -mfloat-abi=hard -march=armv7-r

Is there anything I'm missing here?

  • I just noticed there is a duplicate dwarf option in my options. I have removed the duplicate. Now it's like:

    -g -gdwarf-3 -Wall -mcpu=cortex-r4 -mlittle-endian -r -mfpu=vfpv3-d16 -mfloat-abi=hard -march=armv7-r

    But still no assembler symbols.
  • Erik von Hesse said:
    I am developing a project on RM48x which consists of both C files and assembler files using CCS/GCC toolchain.

    Are you using code generated by HalCoGen? If so, I noticed that the assembly source files generated by HalCoGen define their functions as "weak" which I think may be the reason for the debug behavior you are seeing. If this is the case in your environment, I would suggest posting to the Hercules forum as the experts there should be able to better clarify the reasoning behind using "weak" functions in their assembly routines.

  • It has nothing to do with the .weak directive. I am trying to debug my own assembler functions which use the .global directive. It just seems that there is no debugging info of the assembler files, no symbols, no source links.
  • Erik von Hesse said:
    It just seems that there is no debugging info of the assembler files, no symbols, no source links.

    Do the global symbols from assembly files show up in the link map file and final .out file (you can check this by running an object dump utility on the .out file)? If so, then we'd need to look at the why the CCS debugger is not able to recognize them. If they are not in the build output itself, it is an issue on the GCC build side.

    Can you send us a simple project that we can use to reproduce the issue?

  • The global symbols show up in the map, and they can also be seen in the disassembly view. I guess the real issue here is that the source code linking to the assembler source files doesn't work at all.

    The issue showed up after I ported my project from TI toolchain (which worked really well) to GCC toolchain (according to customer requirement), so I currently cannot send you a simple project with that issue, cuz I am in sort of crunch time here.