分页: 1 / 1

求救,ubuntu下不能执行二进制的可执行文件。

发表于 : 2008-12-02 21:53
colinyao
我打开GDB,调试刚刚用gcc编译的test文件,执行(gdb)run时,提示无法执行二进制文件,在shell下直接执行./test也是说无法执行二进制文件,请问这是什么问题啊?

Re: 求救,ubuntu下不能执行二进制的可执行文件。

发表于 : 2008-12-03 10:38
colinyao
以下是终端显示信息:
colinyao@colinyao-desktop:~$ arm-linux-gcc -g test.c -o test
colinyao@colinyao-desktop:~$ gdb
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
(gdb) file test
Reading symbols from /home/colinyao/test...done.
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) list
1 #include <stdio.h>
2 int main()
3 {
4 int a,b,c;
5 a=9;
6 b=3;
7 c=a/b;
8 printf("The result of %d/%d is %d\n",a,b,c);
9 return 0;
10 }
(gdb) run
Starting program: /home/colinyao/test
/bin/bash: /home/colinyao/test:无法执行二进制文件
/bin/bash: /home/colinyao/test: Success

Program exited with code 01.
You can't do that without a process to debug.
(gdb)

Re: 求救,ubuntu下不能执行二进制的可执行文件。

发表于 : 2008-12-03 10:43
xhy
交叉编译?

当然是要在目标平台运行了