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.

Debugging linux app with Gdbserver on K2H evm



Hi,

Gdbserver is in target file system by default on K2 MCSDK 3.0.

Does anyone try to debug linux app with CCS on K2H evm ?
I tried it with a simple hello world but the following error message was displayed on CCS console when launching CCS debugger:-

====== CCS console =======
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
========================

Please note I just followed the following recipe to launch gdb debugger.
At the step 9 in this recipe, the above errors happened.

http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5#Run_Mode_Debug

For your information, Gdb Debugger being used is sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gdb, which is coming from ~ti/mcsdk_linux_3_00_03_15/linux-devkit
and Gdb init file being used is <tool chain install dir>/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/share/gdb/gdbinit

I'm not sure these configurations are really correct..

Lastly, I'm using CCSv5.5 on Ubuntu 12.04LTS. The version of MCSDK is the latest release (v3.0) found at http://www.ti.com/tool/bioslinuxmcsdk

Thanks
Kawada

  • Hi, Kawada,

    Let me try it and get back to you.

    Rex

  • Hi, Dawada,

    I looked at how you set it up. I think you are using the wrong gdbserver and client. The server should be the one come in the file system in /usr/bin/gdbserver, and the client should be in the tool chain bin directory, arm-linux-gnueabihf-gdb, which should be the one entered in step 6 for the GDB debugger if that is not what you have.

    Rex

  • Hello Rex,

    Thank you very much for your help.

    I changed gdbserver client configuration with the one in tool chain, the error I mentioned before has been disappeared. Thank you.  However, I have another problem now. CCS raised the following error during launching CCS:

      

    Do you have any comments on this ?
    This seems gdbinit related issue. Do you think gdbinit I'm using is correct one ?

    Best Regards,
    Kawada

  • Hi, Kawada,

    The document says "browse to the .gdbinit file in the SDK install directory". You should look in the MCSDK directory, not the tool chain directory. You should use the gdbinit in linux-devkit.

    Rex

  • Hello Rex,

    I used gdbinit (not .gdbinit) because I could not find .gdbinit in linux-devkit.
    I extracted linux-devkit (by executing the script found at ~/ti/mcsdk_linux_3_00_03_15/linux-devkit) to ~/sdk.

    Here is the result of find command to find .gdbinit file :-

    ubuntu@ubuntu:~/sdk$ find . -name "*gdbinit"
    ./sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/src/kernel/Documentation/frv/gdbinit
    ./sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/src/kernel/arch/m32r/platforms/mappi3/dot.gdbinit
    ./sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/src/kernel/arch/m32r/platforms/mappi/dot.gdbinit
    ./sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/usr/src/kernel/arch/m32r/platforms/opsput/dot.gdbinit
    ubuntu@ubuntu:~/sdk$

    As you see, there is no .gdbinit file in linux-devkit.
    So, I tried to find the same file in tool chain directory. I could not find that file, but I noticed that
    gdbinit file was there. So, I just tried this file and then I faced to the error I mentioned you before.

    Can you suggest me where .gdbinit file is ?

    Best Regards,
    Kawada

  • Hi Rex,

    By creating .gdbinit by myself, I succeeded to launch CCS/GDB debugger.
    Now I can debug my app with it. Thanks for all your help.

    FYI, The following is the contents of .gdbinit

    set solib-absolute-prefix <path to NFS root file system>

    Best Regards,
    Kawada