⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdbserver调试遇到的问题1

📁 uClinux里自带的gdbserver在arm7tdmi下不能正常工作
💻
📖 第 1 页 / 共 2 页
字号:
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link rel="stylesheet" href="http://www.linuxforum.net/forum/stylesheets/stylesheet2.css" type="text/css"><TITLE>gdbserver调试遇到的问题 - China Linux Forum</TITLE></HEAD><BODY><SPAN CLASS="onbody"> <table width=95% border=0 cellspacing=0 cellpadding=3 align="center" class="p9">
<tr bgcolor=#0099cc align=right valign=middle>
<td width=20% align="left"> <a href="/index.php"><font color="#FFFFFF">中国Linux论坛首页</font></a></td>
<td width=80%>
 <a href="/forum/ubbthreads.php"><font color=#FFFFFF>技术论坛|</font></a><fon
t color="#FFFFFF">
 <a href=/docnew/index.php><font color=#FFFFFF>文章荟萃</font></a><font color="#FFFFFF">|
 <a href=/books/index.php><font color=#FFFFFF>藏经阁</font></a>|
 <a href="http://sf.linuxforum.net"><font color=#FFFFFF>项目计划</font></a>|
 <a href=/poll2/index.php><font color=#FFFFFF>在线调查</font></a>|
 <a href="http://www.linuxforum.net/mirror.php"><font color=#FFFFFF>网站镜像</font></a>|
 <a href="http://www.linuxforum.net/mirror.php"><font color=#FFFFFF>软件仓库</font></a>|
 <a href=/about.php><font color=#FFFFFF>关于本站</font></a>|
</td></tr></table>
<br>
   
</SPAN> <TABLE WIDTH="95%" ALIGN="center" CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD class="tableborders"><TABLE CELLPADDING="3" CELLSPACING="1" WIDTH=100% BORDER=0>      <tr><td align="right" class="menubar">   <a href="http://www.linuxforum.net/forum/ubbthreads.php?Cat=">讨论区列表</a>    |    <a href="http://www.linuxforum.net/forum/search.php?Cat=">搜寻文章</a>    |    <a href="http://www.linuxforum.net/forum/newuser.php?Cat=">新用户注册</a>    |    <a href="http://www.linuxforum.net/forum/login.php?Cat=">登入论坛</a>    |    <a href="http://www.linuxforum.net/forum/online.php?Cat=">在线用户</a>    |    <a href="http://www.linuxforum.net/forum/faq_chinese.php?Cat=">常见问题</a>           </TD></TR></TABLE></TD></TR></TABLE>      <p> <TABLE WIDTH="95%" ALIGN="center" CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD class="tableborders"><TABLE CELLPADDING="3" CELLSPACING="1" WIDTH=100% BORDER=0>      <TR class="darktable"><td><table width=100% cellpadding=0 cellspacing=0><tr class="darktable"><td align=left width="33%"><span class="catandforum"><a href="http://www.linuxforum.net/forum/ubbthreads.php?Cat=&C=4">Linux 高级应用</a><br>&nbsp;&nbsp;&nbsp;>><a href="http://www.linuxforum.net/forum/postlist.php?Cat=&Board=embedded&page=1&view=collapsed&sb=9&o=">Linux 嵌入技术</a></span></td><td width="33%" align=center>此话题阅读次数: 3434</td><td width="33%" align=right>   <table border=0><tr><td class=navigation nowrap><img alt="*" src="http://www.linuxforum.net/forum/images/greyflat.gif" align=absmiddle>平坦模式&nbsp;</td><td class=navigation nowrap><a href="http://www.linuxforum.net/forum/showthreaded.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&vc=1"><img align=absmiddle src="http://www.linuxforum.net/forum/images/threaded.gif" alt="树状模式,一封一封读" border=0>树状模式</a>&nbsp;</td></tr></table></td></tr></table>   </TD></TR></TABLE></TD></TR></TABLE>      <br><table width="95%" align="center" cellpadding=4 cellspacing=0 border=0><tr><td align=left class=small>   <img src="http://www.linuxforum.net/forum/images/pages.gif" align=absmiddle> 此话题的页数:1 | <a href="http://www.linuxforum.net/forum/showflat.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&fpart=2&vc=1">2</a> | <a href="http://www.linuxforum.net/forum/showflat.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&fpart=3&vc=1">3</a> | <a href="http://www.linuxforum.net/forum/showflat.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&fpart=4&vc=1">4</a> | (<a href="http://www.linuxforum.net/forum/showflat.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&fpart=all&vc=1">显示全部</a>) &nbsp; </td><td class=small align=right> <a target="_blank" href="http://www.linuxforum.net/forum/printthread.php?Cat=&Board=embedded&main=515267&type=thread"><img src="http://www.linuxforum.net/forum/images/printthread.gif" align=top border=0> 打印</a></td></tr></table>    <TABLE WIDTH="95%" ALIGN="center" CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD class="tableborders"><TABLE CELLPADDING="3" CELLSPACING="1" WIDTH=100% BORDER=0>      <tr><td rowspan=2 width="17%" valign=top class="darktable"><a name="Post515267"></a><a href="http://www.linuxforum.net/forum/showprofile.php?Cat=&User=hitgyh&Number=515267&Board=embedded&what=showflat&page=1&view=collapsed&sb=9&o=&fpart=1&vc=1">hitgyh</a><br><span class="small">(stranger)<br>            04-09-24 08:37<br></span></td><td width=83% class="subjecttable">        <table width=100% class="subjecttable" border=0><tr><td align=left width=70%><img src="http://www.linuxforum.net/forum/images/icons/book.gif" width="15" height="15"> <b>gdbserver调试遇到的问题</b>          </td><td align="right" width=30%>&nbsp;</td></tr></table></td></tr><tr><td width=83% class="lighttable"><br><P class="post">交叉调试环境终于眼看成功了,可是却碰到一个小问题:
<br>通过minicom我在开发板端输入:gdbserver 192.168.0.11:5050 foo,出现下面信息:
<br>Process foo created; pid=31
<br>code at 0c39c040-0c39d160, data at 0c39d164
<br>然后我在宿主机输入:gdb -q
<br>                                      (gdb) target remote 192.168.0.100:5050
<br>过一会儿后宿主机出现如下信息:
<br>                                     Remote debugging using 192.168.0.100:5050
<br>                                     Couldn't establish connection to remote target
<br>                                     Reply contains invalid hex digit 59
<br>在minicom(开发板端)出现如下信息:
<br>                        Remote debugging using 192.168.0.11:5050
<br>                         Readchar : Got EOF
<br>                        Remote side has terminated connection. GDBserver will reopen the connection
<br>(注:192.168.0.11是PC的IP,192.168.0.100是开发板的IP,
<br>       foo是我要调试的程序,我已经将它编译到内核,开发板上电运行操作系统后,从   minicom里能够看见它位于文件甲bin下,我启动gdbserver前已经进入bin的目录下了)  <br><br><br>--------------------<br>世界因我而美丽<p class=small>文章选项:<a target="_blank" href="http://www.linuxforum.net/forum/printthread.php?Cat=&Board=embedded&main=515267&type=post"><img align=absmiddle alt="打印" src="http://www.linuxforum.net/forum/images/print.gif" border=0></a>         </td></tr><tr><td rowspan=2 width="17%" valign=top class="darktable"><a name="Post515273"></a><a href="http://www.linuxforum.net/forum/showprofile.php?Cat=&User=hitgyh&Number=515273&Board=embedded&what=showflat&page=1&view=collapsed&sb=9&o=&fpart=1&vc=1">hitgyh</a><br><span class="small">(stranger)<br>            04-09-24 09:02<br></span></td><td width=83% class="subjecttable">        <table width=100% class="subjecttable" border=0><tr><td align=left width=70%><img src="http://www.linuxforum.net/forum/images/newicons/book.gif" width="15" height="15"> <b>Re: gdbserver调试遇到的问题</b> <img alt="新" src="http://www.linuxforum.net/forum/images/new.gif">          <font class="small">[<a href="http://www.linuxforum.net/forum/showthreaded.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&vc=1" target="_new">re: hitgyh</a>]</font></td><td align="right" width=30%>&nbsp;</td></tr></table></td></tr><tr><td width=83% class="lighttable"><br><P class="post">刚才查了资料,好像要用交叉调试工具,我用的是:arm-elf-tools-20030314.sh,可是我起动不了arm-elf-gdb,但是arm-elf-gcc能用.当我输入arm-elf-gdb时出现以下信息:
<br>arm-elf-gdb:error while loading shared libraries:libncurses.so.4:cannot open shared object file : No such file or diectory  <br><br><br>--------------------<br>世界因我而美丽<p class=small>文章选项:<a target="_blank" href="http://www.linuxforum.net/forum/printthread.php?Cat=&Board=embedded&main=515273&type=post"><img align=absmiddle alt="打印" src="http://www.linuxforum.net/forum/images/print.gif" border=0></a>         </td></tr><tr><td rowspan=2 width="17%" valign=top class="darktable"><a name="Post515530"></a><a href="http://www.linuxforum.net/forum/showprofile.php?Cat=&User=hitgyh&Number=515530&Board=embedded&what=showflat&page=1&view=collapsed&sb=9&o=&fpart=1&vc=1">hitgyh</a><br><span class="small">(stranger)<br>            04-09-25 12:03<br></span></td><td width=83% class="subjecttable">        <table width=100% class="subjecttable" border=0><tr><td align=left width=70%><img src="http://www.linuxforum.net/forum/images/newicons/book.gif" width="15" height="15"> <b>Re: gdbserver调试遇到的问题</b> <img alt="新" src="http://www.linuxforum.net/forum/images/new.gif">          <font class="small">[<a href="http://www.linuxforum.net/forum/showthreaded.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&vc=1" target="_new">re: hitgyh</a>]</font></td><td align="right" width=30%>&nbsp;</td></tr></table></td></tr><tr><td width=83% class="lighttable"><br><P class="post">郁闷,重装了,系统的arm-elf-gdb能运行了,按照上面的步骤还是有问题,宿主机信息:
<br>(gdb)target remote 192.168.0.100:5050
<br>Remote debugging using 192.168.0.100:5050
<br>Couldn't establish connection to remote target
<br>Reply contains invalid hex digit 59
<br>\开发板信息:
<br>Remote debugging using 192.168.0.100:5050
<br>readchar:Got EOF
<br>Remote side has terminated connection. GDBserver will reopen the connection  <br><br><br>--------------------<br>世界因我而美丽<p class=small>文章选项:<a target="_blank" href="http://www.linuxforum.net/forum/printthread.php?Cat=&Board=embedded&main=515530&type=post"><img align=absmiddle alt="打印" src="http://www.linuxforum.net/forum/images/print.gif" border=0></a>         </td></tr><tr><td rowspan=2 width="17%" valign=top class="darktable"><a name="Post515561"></a><a href="http://www.linuxforum.net/forum/showprofile.php?Cat=&User=hitgyh&Number=515561&Board=embedded&what=showflat&page=1&view=collapsed&sb=9&o=&fpart=1&vc=1">hitgyh</a><br><span class="small">(stranger)<br>            04-09-25 15:37<br></span></td><td width=83% class="subjecttable">        <table width=100% class="subjecttable" border=0><tr><td align=left width=70%><img src="http://www.linuxforum.net/forum/images/newicons/book.gif" width="15" height="15"> <b>Re: gdbserver调试遇到的问题</b> <img alt="新" src="http://www.linuxforum.net/forum/images/new.gif">          <font class="small">[<a href="http://www.linuxforum.net/forum/showthreaded.php?Cat=&Board=embedded&Number=515267&page=1&view=collapsed&sb=9&o=&vc=1" target="_new">re: hitgyh</a>]</font></td><td align="right" width=30%>&nbsp;</td></tr></table></td></tr><tr><td width=83% class="lighttable"><br><P class="post">又试了一遍,我是先启动的gdbserver,然后用的arm-elf-gdb:
<br>PC端:
<br>[root@gyh foo]# arm-elf-gdb foo.gdb
<br>GNU gdb 5.0
<br>Copyright 2000 Free Software Foundation, Inc.
<br>GDB is free software, covered by the GNU General Public License, and you are
<br>welcome to change it and/or distribute copies of it under certain conditions.
<br>Type "show copying" to see the conditions.
<br>There is absolutely no warranty for GDB.  Type "show warranty" for details.
<br>This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
<br>(gdb) target remote 192.168.0.100:2352
<br>Remote debugging using 192.168.0.100:2352
<br>Couldn't establish connection to remote target
<br>Reply contains invalid hex digit 59
<br>(gdb)
<br>开发板端:
<br># gdbserver 192.168.0.100:2352 foo
<br>Process foo created; pid = 32
<br>code at 0c3a4040 - 0c3a5160, data at 0c3a5164
<br>Remote debugging using 192.168.0.100:2352
<br>readchar: Got EOF
<br>RemotRxLength more long than 5ea
<br>e side has terminated connection.  GDBserver will reopen the connection.  <br><br><br>--------------------<br>世界因我而美丽<p class=small>文章选项:<a target="_blank" href="http://www.linuxforum.net/forum/printthread.php?Cat=&Board=embedded&main=515561&type=post"><img align=absmiddle alt="打印" src="http://www.linuxforum.net/forum/images/print.gif" border=0></a>         </td></tr><tr><td rowspan=2 width="17%" valign=top class="darktable"><a name="Post515648"></a><a href="http://www.linuxforum.net/forum/showprofile.php?Cat=&User=yxw263&Number=515648&Board=embedded&what=showflat&page=1&view=collapsed&sb=9&o=&fpart=1&vc=1">yxw263</a><br><span class="small">(stranger)<br>            04-09-26 09:26<br></span></td><td width=83% class="subjecttable">        <table width=100% class="subjecttable" border=0><tr><td align=left width=70%><img src="http://www.linuxforum.net/forum/images/newicons/book.gif" width="15" height="15"> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -