当前位置:编程学习 > wap >>

Qt Creator 用gdb远程调试问题

问题:Qt Creator 用gdb远程调试不了,提示
not in executable format: File format is ambiguous.
Matching formats: elf32-littlearm-symbian elf32-littlearm.
Use "set gnutarget format-name" to specify the format.


原来Qt Creator编译正常,X86上Qt Creator自带的gdb 本地调试没问题。
现在我是想做交叉编译后,在ubuntu上远程调试ARM板上Qt程序。
1.我用命令行:ARM板上用 ./arm-linux-gdb 192.168.10.156:1234 test -qws 
          
           ubuntu上用 
           gdb test
           (gdb) target remote 192.168.10.153:1234
Remote debugging using 192.168.10.156:1234
warning: Target-supplied registers are not supported by the current architecture
Remote 'g' packet reply is too long: 0000000044feffbe50feffbe0000000000000000000000000000000000000000000000000000000000000000000000000000000040fdffbe00000000d05efdb6100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

这样似乎是连上板子上gdb
板子打印出:
Remote debugging from host 192.168.10.153
readchar: Got EOF
Remote side has terminated connection.  GDBserver will reopen the connection.
Listening on port 1234

看样子用命令行调试是正常的吧????


2.用Qt Creator 
    
如上图,设置后按开始调试,就是
not in executable format: File format is ambiguous.
Matching formats: elf32-littlearm-symbian elf32-littlearm.
Use "set gnutarget format-name" to specify the format.
不管我GNU目标怎和体系结构怎么选都是不行的,问题何在????????工程有在调试版本模式下编译。

qt gdb 远程调试 --------------------编程问答-------------------- 楼主在板子上装了Qt Creator? --------------------编程问答--------------------
引用 1 楼 haltwang 的回复:
楼主在板子上装了Qt Creator?


没有,不是,是PC机ubuntu上,所以才需要远程调试嘛。 --------------------编程问答--------------------
引用 2 楼 meiky 的回复:
引用 1 楼 haltwang 的回复:楼主在板子上装了Qt Creator?

没有,不是,是PC机ubuntu上,所以才需要远程调试嘛。


我每次都是用调试的串口,发到minicom上看的 --------------------编程问答--------------------
引用 3 楼 haltwang 的回复:
引用 2 楼 meiky 的回复:引用 1 楼 haltwang 的回复:楼主在板子上装了Qt Creator?

没有,不是,是PC机ubuntu上,所以才需要远程调试嘛。

我每次都是用调试的串口,发到minicom上看的


你没用gdb吧,没用调试工具我也是用串口打印字符串来调试。现在想用gdb远程调试板子。 --------------------编程问答--------------------
引用 4 楼 meiky 的回复:
引用 3 楼 haltwang 的回复:引用 2 楼 meiky 的回复:引用 1 楼 haltwang 的回复:楼主在板子上装了Qt Creator?

没有,不是,是PC机ubuntu上,所以才需要远程调试嘛。

我每次都是用调试的串口,发到minicom上看的

你没用gdb吧,没用调试工具我也是用串口打印字符串来调试。现在想用gdb远程调试板子。
  ……


还能这样弄呢, 学习了。
是不是就可以设断点什么的了 --------------------编程问答--------------------
引用 5 楼 haltwang 的回复:
引用 4 楼 meiky 的回复:引用 3 楼 haltwang 的回复:引用 2 楼 meiky 的回复:引用 1 楼 haltwang 的回复:楼主在板子上装了Qt Creator?

没有,不是,是PC机ubuntu上,所以才需要远程调试嘛。

我每次都是用调试的串口,发到minicom上看的

你没用gdb吧,没用调试工具我也是用串口打印字符串来调试。……


是啊,我现在就在学习搞这东东, --------------------编程问答-------------------- 有没有同学用Qt Creator 调试过 Arm啊。。。。。。。 --------------------编程问答-------------------- 难道真那么少人搞这个 --------------------编程问答-------------------- 我现在在Linux 9131-TestMAC-Compile 2.6.32-33-generic-pae #70-Ubuntu SMP Thu Jul 7 22:51:12 UTC 2011 i686 GNU/Linux上面编译gdb,mount到目标机上,
./gdb testmac9131
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /mnt/testmac/testmac9131...I'm sorry, Dave, I can't do that.  Symbol format `elf32-powerpc' unknown.
--------------------编程问答--------------------
引用 8 楼 meiky 的回复:
难道真那么少人搞这个
楼主能调试了吗 --------------------编程问答-------------------- 要先在gdb的源码下弄出gdbserver来的,然后在ARM板上运行:
gdbserver 192.168.10.156:1234 app -qws &;
Qt creator中,调试器应该设置为你的arm-linux-gdb;
主机和端口号为你的板子的IP和端口号;
体系结构是arm;
GNU目标是arm-none-linux-gnueabi
补充:移动开发 ,  Qt
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,