<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi,</p>
<p><br>
</p>
<p>I want to debug an RTEMS application using gdb on a board which is based on zynq. For the reference, I have followed the directions at following link (<a href="https://devel.rtems.org/wiki/Boards/Zynq%20-%20Zedboard" class="OWAAutoLink">https://devel.rtems.org/wiki/Boards/Zynq%20-%20Zedboard</a>)</p>
<p><br>
</p>
<p>The setup looks as follows:</p>
<ol style="margin-bottom: 0px; margin-top: 0px;">
<li>I boot the board which loads u-boot. Using tftpboot, I run the debugger application.
<div><span style="color: rgb(0, 111, 201);">Zynq> tftpboot 0x1000000 192.168.178.6:debugger.img </span><br>
<span style="color: rgb(0, 111, 201);">Using ethernet@e000b000 device </span><br>
<span style="color: rgb(0, 111, 201);">TFTP from server 192.168.178.6; our IP address is 192.168.178.1 </span><br>
<span style="color: rgb(0, 111, 201);">Filename 'debugger.img'. </span><br>
<span style="color: rgb(0, 111, 201);">Load address: 0x1000000 </span><br>
<span style="color: rgb(0, 111, 201);">Loading: ################################################################# </span><br>
<span style="color: rgb(0, 111, 201);"> ############## </span><br>
<span style="color: rgb(0, 111, 201);"> 2.1 MiB/s </span><br>
<span style="color: rgb(0, 111, 201);">done </span><br>
<span style="color: rgb(0, 111, 201);">Bytes transferred = 1150728 (118f08 hex) </span><br>
<span style="color: rgb(0, 111, 201);">Zynq> bootm 0x1000000 </span><br>
<span style="color: rgb(0, 111, 201);">## Booting kernel from Legacy Image at 01000000 ... </span><br>
<span style="color: rgb(0, 111, 201);"> Image Name: RTEMS </span><br>
<span style="color: rgb(0, 111, 201);"> Image Type: ARM RTEMS Kernel Image (gzip compressed) </span><br>
<span style="color: rgb(0, 111, 201);"> Data Size: 1150664 Bytes = 1.1 MiB </span><br>
<span style="color: rgb(0, 111, 201);"> Load Address: 00104000 </span><br>
<span style="color: rgb(0, 111, 201);"> Entry Point: 00104000 </span><br>
<span style="color: rgb(0, 111, 201);"> Verifying Checksum ... OK </span><br>
<span style="color: rgb(0, 111, 201);"> Uncompressing Kernel Image ... OK </span><br>
<span style="color: rgb(0, 111, 201);">## Transferring control to RTEMS (at address 00104000) ... </span><br>
<span style="color: rgb(0, 111, 201);">*** LIBBSD DEBUGGER 1 TEST *** </span><br>
<span style="color: rgb(0, 111, 201);"> </span><br>
<span style="color: rgb(0, 111, 201);">RTEMS Shell on /dev/console. Use 'help' to list commands. </span><br>
<span style="color: rgb(0, 111, 201);">SHLL [/] # nexus0: <RTEMS Nexus device> </span><br>
<span style="color: rgb(0, 111, 201);">cgem0: <Cadence CGEM Gigabit Ethernet Interface> on nexus0 </span><br>
<span style="color: rgb(0, 111, 201);">miibus0: <MII bus> on cgem0 </span><br>
<span style="color: rgb(0, 111, 201);">e1000phy0: <Marvell 88E1512 Gigabit PHY> PHY 0 on miibus0 </span><br>
<span style="color: rgb(0, 111, 201);">e1000phy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDXo</span><br>
<span style="color: rgb(0, 111, 201);">info: cgem0: Ethernet address: 00:0a:35:00:01:01 </span><br>
<span style="color: rgb(0, 111, 201);">zy7_slcr0: <Zynq-7000 slcr block> on nexus0 </span><br>
<span style="color: rgb(0, 111, 201);">info: lo0: link state changed to UP </span><br>
<span style="color: rgb(0, 111, 201);">info: cgem0: link state changed to DOWN </span><br>
<span style="color: rgb(0, 111, 201);">add host 192.168.100.11: gateway cgem0 </span><br>
<span style="color: rgb(0, 111, 201);">add net default: gateway 192.168.100.11 </span><br>
<span style="color: rgb(0, 111, 201);">[CPU:0] rtems-db: remote running </span><br>
<span style="color: rgb(0, 111, 201);">[CPU:0] rtems-db: tcp remote: listing on port: 1122 </span><br>
<span style="color: rgb(0, 111, 201);">info: cgem0: link state changed to UP</span></div>
</li><li><span style="color: rgb(0, 111, 201);"><span style="color: rgb(0, 0, 0);">On the remote PC, I launch the application using gdb
<div><span style="color: rgb(0, 111, 201);">arm-rtems5-gdb example_rtems_shell</span><br>
<span style="color: rgb(0, 111, 201);">GNU gdb (GDB) 8.3</span><br>
<span style="color: rgb(0, 111, 201);">Copyright (C) 2019 Free Software Foundation, Inc.</span><br>
<span style="color: rgb(0, 111, 201);">License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html></span><br>
<span style="color: rgb(0, 111, 201);">This is free software: you are free to change and redistribute it.</span><br>
<span style="color: rgb(0, 111, 201);">There is NO WARRANTY, to the extent permitted by law.</span><br>
<span style="color: rgb(0, 111, 201);">Type "show copying" and "show warranty" for details.</span><br>
<span style="color: rgb(0, 111, 201);">This GDB was configured as "--host=x86_64-linux-gnu --target=arm-rtems5".</span><br>
<span style="color: rgb(0, 111, 201);">Type "show configuration" for configuration details.</span><br>
<span style="color: rgb(0, 111, 201);">For bug reporting instructions, please see:</span><br>
<span style="color: rgb(0, 111, 201);"><http://www.gnu.org/software/gdb/bugs/>.</span><br>
<span style="color: rgb(0, 111, 201);">Find the GDB manual and other documentation resources online at:</span><br>
<span style="color: rgb(0, 111, 201);"> <http://www.gnu.org/software/gdb/documentation/>.</span><br>
<br>
<span style="color: rgb(0, 111, 201);">For help, type "help".</span><br>
<span style="color: rgb(0, 111, 201);">Type "apropos word" to search for commands related to "word"...</span><br>
<span style="color: rgb(0, 111, 201);">Reading symbols from spwipc_example_rtems_shell...</span><br>
<span style="color: rgb(0, 111, 201);">(gdb) target remote 192.168.178.1:1122</span><br>
<span style="color: rgb(0, 111, 201);">Remote debugging using 192.168.178.1:1122</span><br>
<span style="color: rgb(255, 0, 0);">0x0022ddd0 in ip6qb ()</span><br>
<span style="color: rgb(0, 111, 201);">(gdb) break runExample</span><br>
<span style="color: rgb(0, 111, 201);">Breakpoint 1 at 0x1046ae: file examples/rtems_shell/rtems_shell.cpp, line 20.</span><br>
<span style="color: rgb(0, 111, 201);">(gdb) c</span><br>
<span style="color: rgb(0, 111, 201);">Continuing.</span><br>
</div>
</span></span></li></ol>
<div><br>
</div>
<div>The program never breaks at runExample. However, if I launch the application without debugger on the host board using tftpboot, it works fine. Is there something that I am missing ? What is the meaning of the line marked in red (<span style="color: rgb(0, 111, 201);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(255, 0, 0);">0x0022ddd0
in ip6qb ()</span></span></span>). I tried to debug other applications too and the address
<b>0x0022ddd0</b> is always displayed. <br>
</div>
<div>It would be great if someone could help with the answer.</div>
<div><br>
</div>
<div>Thanks & Regards</div>
<div>Vishav<br>
</div>
</div>
</body>
</html>