Project

General

Profile

Debugging in CCSv5 using GDB

Added by Steven Hill about 11 years ago

I am using CCSv5 to create projects using the Critical Link toolchain. This is working fine - DSPHelloWorld etc run on the target with no issues. Now I would like to use GDB to debug remotely runninf gdbserver on the target. Ihave created a remote application debug using the manual remote debugging launcher and it is tantalizingly close to working...but not quite. Here is the message I get when starting up:

warning: while parsing target description (at line 1): Target description specified unknown architecture "arm"
warning: Could not load XML target description; ignoring
warning: `/usr/local/oecore-i686/sysroots/armv5te-angstrom-linux-gnueabi/lib/ld-linux.so.3': Shared library architecture unknown is not compatible with target architecture i386.
warning: `/usr/local/oecore-i686/sysroots/armv5te-angstrom-linux-gnueabi/lib/ld-linux.so.3': Shared library architecture unknown is not compatible with target architecture i386.

Can anyone suggest how to fix this?


Replies (12)

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

More information - I discovered that I was using the default gdb, so changed that to the 'usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/armv5te-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gdb' version of gfb. I have created a .gdbinit that sets the library prefix to '/usr/local/oecore-i686/sysroots/armv5te-angstrom-linux-gnueabi'

Now the process does not get as far, and the messages that I am getting are:

Traceback (most recent call last):
File main()
File known_paths = addusersitepackages(known_paths)
File user_site = getusersitepackages()
File user_base = getuserbase() # this will also set USER_BASE
File USER_BASE = get_config_var('userbase')
File return get_config_vars().get(name)
File _init_posix(_CONFIG_VARS)
File makefile = _get_makefile_filename()
File return os.path.join(get_path('platstdlib').replace(AttributeError: 'module' object has no attribute 'pydebug'

and the gdb process terminates

Any ideas on how to get past this error?

RE: Debugging in CCSv5 using GDB - Added by Bob Duke about 11 years ago

Hello Steven,

Are you running CCSv5 from a Critical Link Virtual Machine image or from your own Linux distribution (or on Windows)?

-Bob

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

I am running with a Ubuntu Linux distribution - 12.04LTS in VirtualBox Manager.

More information - 'gdb' run from the terminal connects to my running application (but not usefully I think), but running 'arm-angstrom-linux-gnueabi-gdb' gives the following:

Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 337, in _init_posix
makefile = _get_makefile_filename()
File "/usr/lib/python2.7/sysconfig.py", line 331, in _get_makefile_filename
return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'

... and quits

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

I followed the steps in the 'VM Build Steps" part of the Linux Build Virtual Machine tutorial - except that I installed 12.04LTS instead of 10.04LTS.

RE: Debugging in CCSv5 using GDB - Added by Bob Duke about 11 years ago

Steven,

It looks like it's trying to use the distribution's python (which likely doesn't have the pydebug package).

Please verify you have a python executable at:
/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/python

If so, please add /usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/ to the start of your $PATH and try again:

$ export PATH=/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin:$PATH

-Bob

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

I don't have a python directory in the /usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin directory, but there are python executables there: 'python' and 'python2.7'.

The PATH variable already included the path to /usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin, so the problem still exists.

RE: Debugging in CCSv5 using GDB - Added by Bob Duke about 11 years ago

Steven,

That looks good, I accidentally included "python" in the directory name. You have confirmed the python executables are there.

When you run this command what do you get?

$ which python

You should get "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/bin/python".

If you do not (you may get something like /usr/bin/python), please run the export command in my previous post and try again. Order matters in the PATH variable.

-Bob

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

'which python' returns the version that is in /usr/local/oecore-i686...

But if I run 'arm-angstrom-linux-gnueabi-gdb' I get the same result as I detailed above... ending in '...no attribute 'pydebug''

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

I would appreciate some help with this - I have no idea how to solve this problem. Without GDB working I have no way to debug my application running on top of linux.

RE: Debugging in CCSv5 using GDB - Added by Bob Duke about 11 years ago

Steve,

I have been unable to reproduce the issue and the obvious parts of your python environment seem to be configured correctly.

My understanding is that the pydebug error occurs when the tool is using the wrong version of python. The fact that the error message points to /usr/lib/python2.7/ (which is the OS-installed python) tells me that it's looking in the wrong place (the correct version would be under /usr/local/oecore-i686/).

Given this, I can suggest a few options:

1. Create a sample project that exhibits this error and send me the zipped up project directory and I can try it here.
2. Try a setup with Ubuntu 10.04 following the steps here: http://support.criticallink.com/redmine/projects/arm9-platforms/wiki/Linux_Build_VM. There may be a difference in how python is managed in 12.04. In addition, the tools you install with apt-get under 12.04 will be different versions than those installed under 10.04 so that may be another source of configuration problems.

-Bob

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

Thanks for your reply - I have put this issue on the back burner as I am now working on DSP side software for a while...but I will get back to it.

RE: Debugging in CCSv5 using GDB - Added by Steven Hill about 11 years ago

I followed option 2, and now have GDB working. I did a lot of searching on the net, and it seems that the issue with gdb and python is known in Ubuntu 12.04, so I would advise anyone working with the MityDSP development system NOT to do what I did, installing the latest Ubuntu in the virtual machine, but work with the Critical Link ova file. It would have saved me a lot of time and grief. Thanks for your help.

    (1-12/12)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)