Debugging tools

Hi all,

I want to use some debugging tools likes Performance Analysis or Real-time chart for my project, so I go at Projet -> Properties -> C/C++ Build -> Settings -> Debugging, then I check Generate prof information and/or Generate gprof information, but when I build my project I have the error :

c:/program files (x86)/gnu tools arm embedded/4.9 2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lc_p

This is a library ?

Thanks in advance

  • The linker is trying to find a version of the C runtime library with profiling support. However, the GNU ARM launchpad GCC toolchain does not come with such a version of the C runtime library.

    You could have a look at this tutorial :-

    but in e2studio, we do not support semihosted filesystem access, only semihosted printf() output to the console.

  • In reply to Jeremy:

    Thank you for your reply, I will take a look of this tutorial

  • Did support ever provide a more specific answer on how to use gprof in e2studio, besides looking at this tutorial for eclipse on web?
  • In reply to John Taft:

    Hello, John.

    The following Web page could be an answer.

    Profiling C code on Windows when using Eclipse

  • In reply to John Taft:

    Using the information in the link I originally posted here, it is possible to get gprof to work with Synergy (I have attached my project where gprof profiling is enabled). However, there are issues.


    1) As detailed in the original link. gprof is intrusive. It requires the code to be instrumented (compiled with -pg option set in the Cross ARM C Compiler->Miscellaneous->Other compiler flags for certain files and directories, not on the whole project) which adds code to each function call.( Don't add the -pg switch to the actual profiling code!)

    2) Additional memory is required on the embedded system to store the profiling information.

    3) As the Systick timer interrupt is in encrpyted source in the SSP, I used an AGT timer to provide the 1ms timer tick, and edit the AGT interrupt handler to do the PC sampling (hence the agt timer code in src\r_agt directory).

    4) E2studio gdb server with JLink does not provide a semihosted filesystem (semihosted filesytem is described in the original link), so to get the gmon.out file out of the embedded system is more difficult. In my test project I create the file in a RAM buffer on the Synergy device, then export that memory (as RAW binary) to the file gmon.out in the project directory on the PC (this was  the quickest and easiest way to do it).


    After the gmon.out file has been created, the gprof plugin for eclipse can be used to view the results :-




    this requires the ARM tool chain binaries to be on the PATH, so I use a batch file to launch e2studio (as detailed in the original link, but mine is much simplified):-


    set PATH=%PATH%;C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q3\arm-none-eabi\bin\


    and I had to copy some of the binaries into this directory, and remove the "arm-none-eabi" from the file name :-



    and the GPROF plugin to be installed in e2studio (I am using 6.2.1):-