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.

Error when executing gdbserver on AM389x



I'm trying to debug a simple "Hello World" app using gdbserver.  I had to build gdb and gbdserver from source since the file system in the PSP that I received did not include it.  Both gdb and gdbserver seemed to build cleanly but when I execute gdbserver on my target device (AM389x), I get the following:

>gdbserver hostIpAddress:10000 /home/root/hello_world

/bin/gdbserver: line 1:  syntax error: word unexpected (expecting ")")

Note:  In the actual command that I execute above, I have a valid IP address where  hostIpAddress is.

It doesn't seem to matter what parameters I pass into gdbserver I always get the same error: /bin/gdbserver: line 1: syntax error: word unexpected (expecting ")")

My suspicion is that the gdbserver is built incorrectly but I don't know how to verify this?

 

Here are the steps I used to build GDB and GDB server:

1) download GDB 7.2

2) create gbd_AM389x directory off of the main GDB source tree 

3) cd into gbd_AM389x

4) configure the GDB make file by: ../configure --target=arm-none-linux-gnueabi

5) execute make

6) create gbd_AM389x_server directory off of the main GDB source tree 

7) cd into gbd_AM389x_server

8) configure the GDB server make file by: ../gdb/server/configure --target=arm-none-linux-gnueabi

9) make

Both seem to build cleanly but the error I am seeing when I move the gdbserver from my host machine to the target machine lead me to believe otherwise.  I'm not sure if it makes any difference but my board it setup to mount an NFS root file system which is located on my host machine.  Ideas and suggestions would be appreciated.   

  • There are quite a few threads with this error message on the web. They seem to be related to shell usage most of the times. So it seems your executable does not run as a program but as a script. Then it makes sense that line 1 fails.

    I suggest to check your build process again. Are the ARM tools really called? Also check if you have the same tools as the ones used to build the rest of the file system.

    regards.

  • Thanks Frank.  Yes, this was a build issue.  The gdbserver was not being cross compiled correctly.  What needed to happen was:

    1) Set the CC environment variable to the desired cross-compiler (the ARM tools were not being called correctly)

    2) In step 8 above I needed to add --host=i686-pc-linux-gnu to the configure command: ../gdb/server/configure --target=arm-none-linux-gnueabi --host=i686-pc-linux-gnu  

    If you only put in the target when you run the configure script it will not cross-compile correctly.

    Thanks again.

     

     

     

  • Tyson,

    thank you very much for confirming issue closed and in addition posting the solution. That will for sure help others in the future. That's one of the main goals of the forums.

    Regards.

  • Hi Tyson,

    Even though your problem with gdbserver is solved, you may be interested in looking at the new EZ SDK (http://e2e.ti.com/support/embedded/f/354/t/73060.aspx). This is full SDK supporting AM389x and C6A81x devices and comes with gdbserver and other applications pre-built.

    We would really like to know your feedback on the new SDK.

    --Sid

  • I'll give this a try.  Thanks Sid!

  • Hi everybody,

    I have the similar problem, but the info of the target machine and host machine for me are as follow:

    Target:

    [root@Hiteg /tmp]# uname -amnrspv
    Linux Hiteg 2.6.25.8-Sky #18 Wed Mar 17 13:53:44 CST 2010 armv4tl unknown

     

    Host:

    Linux mylaptop 2.6.32-32-generic-pae #62-Ubuntu SMP i686 GNU/Linux

    CC=/opt/Hiteg/gcc-3.4.5-glibc-2.3.6/arm-linux/bin/arm-linux-gcc

    According to the above information or maybe the following website:
    http://dev.gentoo.org/~armin76/arm/chost.xml

     

    Would you please tell me the proper switches?

    ../gdb/server/configure --target=?? --host=??