Last login: Sun Dec 22 15:48:21 2013 from mycomputer.domain.deThe EOF you see could be that GDB crashed. When this happens, check if your GDB is still running or not.
echo $PWD'>'
chmod 777 /crossdev/helloworld/helloworld;gdbserver :2345 /crossdev/helloworld/helloworld;exit
root@ariag25:~# echo $PWD'>'
/root>
root@ariag25:~# chmod 777 /crossdev/helloworld/helloworld;gdbserver :2345 /cross dev/helloworld/helloworld;exit
Process /crossdev/helloworld/helloworld created; pid = 2324
Listening on port 2345
Remote debugging from host 192.168.21.204
readchar: Got EOF
Remote side has terminated connection. GDBserver will reopen the connection.
Listening on port 2345
The EOF you see could be that GDB crashed. When this happens, check if your GDB is still running or not.
You can also look at the 'gdb traces' to see what is happening with GDB:
http://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F
Remote Debugging FAQ:
http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_debug_a_remote_application.3F
097,342 2-environment-cd /home/super/workspace/helloworld 097,343 2^done 097,344 (gdb) 097,346 3^done 097,346 (gdb) 097,346 3-gdb-set breakpoint pending on 097,347 4^done 097,347 (gdb) 097,347 4-enable-pretty-printing 097,348 &"maintenance set python print-stack off\n" 097,348 5^done 097,349 (gdb) 097,349 5maintenance set python print-stack off 097,358 6-gdb-set print object on 097,358 6^done 097,358 (gdb) 097,359 7-gdb-set print sevenbit-strings on 097,359 7^done 097,359 (gdb) 097,360 8-gdb-set host-charset UTF-8 097,360 8^done 097,360 (gdb) 097,361 9-gdb-set target-charset UTF-8 097,361 9^done 097,361 (gdb) 097,366 10-gdb-set target-wide-charset UTF-32 097,372 10^done 097,372 (gdb) 097,373 11source .gdbinit 097,373 &"source .gdbinit\n" 097,374 11^done 097,374 (gdb) 097,375 12-gdb-set target-async off 097,375 12^done 097,375 (gdb) 097,376 13-gdb-set auto-solib-add on 097,376 13^done 097,376 (gdb) 097,385 14-file-exec-and-symbols /home/super/workspace/helloworld/Debug-cross/helloworld 097,395 14^done 097,395 (gdb) 097,403 15-target-select remote ARIAG25:2345 097,494 =thread-group-created,id="42000" 097,494 =thread-created,id="1",group-id="42000" 097,496 16-list-thread-groups --available 097,513 =thread-group-exited,id="42000" 097,514 15^error,msg="Malformed packet(b) (missing colon): ore:0;\nPacket: 'T050b:00000000;0d:a0fdff\ be;0f:c0a7fdb6;thread:89d;core:0;'\n" 097,514 (gdb) 097,515 16^error,msg="Don't know how to get OS data. Try \"help target\"." 097,515 (gdb) 097,539 17-gdb-exit 097,541 17^exit
[Updated on: Sun, 12 January 2014 18:21]
The EOF you see could be that GDB crashed. When this happens, check if your GDB is still running or not.
You can also look at the 'gdb traces' to see what is happening with GDB:
http://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F
Remote Debugging FAQ:
http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_debug_a_remote_application.3F
warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code."
#include <stdio.h> int main() int a = 5; printf("Hello World!\n"); return 0; Should I worry about this error? Can it be repaired?
P.S. Here is the gdb trace:
844,426 2-environment-cd /home/super/workspace/helloworld 844,430 2^done 844,430 (gdb) 844,430 3-gdb-set breakpoint pending on 844,431 3^done 844,431 (gdb) 844,431 4-gdb-set detach-on-fork on 844,431 4^done 844,431 (gdb) 844,432 5-enable-pretty-printing 844,433 5^done 844,433 (gdb) 844,435 6-gdb-set python print-stack none 844,435 6^done 844,435 (gdb) 844,440 7-gdb-set print object on 844,440 7^done 844,440 (gdb) 844,447 8-gdb-set print sevenbit-strings on 844,447 8^done 844,447 (gdb) 844,450 9-gdb-set host-charset UTF-8 844,452 9^done 844,452 (gdb) 844,452 10-gdb-set target-charset UTF-8 844,452 10^done 844,452 (gdb) 844,453 11-gdb-set target-wide-charset UTF-32 844,453 11^done 844,453 (gdb) 844,454 12source .gdbinit 844,455 &"source .gdbinit\n" 844,457 12^done 844,457 (gdb) 844,457 13-gdb-set target-async off 844,458 13^done 844,458 (gdb) 844,458 14-gdb-set auto-solib-add on 844,458 14^done 844,458 (gdb) 844,462 15-file-exec-and-symbols --thread-group i1 /home/super/workspace/helloworld/Debug-cross/hell\ oworld 844,501 15^done 844,501 (gdb) 844,513 16-target-select remote ARIAG25:2345 844,602 =thread-group-started,id="i1",pid="42000" 844,603 17-list-thread-groups --available 844,604 =thread-created,id="1",group-id="i1" 844,616 18-thread-info 1 844,617 &"warning: Unable to find dynamic linker breakpoint function.\nGDB will be unable to debug s\ hared library initializers\nand track explicitly loaded dynamic code." 844,617 &"\n" 844,640 *stopped,frame={addr="0xb6fda7c0",func="??",args=[]},thread-id="1",stopped-threads="all",cor\ e="0" 844,648 16^connected 844,648 (gdb) 844,649 19-data-evaluate-expression --thread-group i1 "sizeof (void*)" 844,792 17^done,groups=[{id="1",type="process",description="init [2]",user="root",cores=["0"]},{id="\ 2",type="process",description="[kthreadd]",user="root",cores=["0"]},{id="3",type="process",descripti\ on="[ksoftirqd/0]",user="root",cores=["0"]},{id="4",type="process",description="[kworker/0:0]",user=\ "root",cores=["0"]},{id="5",type="process",description="[kworker/0:0H]",user="root",cores=["0"]},{id\ ="6",type="process",description="[kworker/u2:0]",user="root",cores=["0"]},{id="7",type="process",des\ cription="[khelper]",user="root",cores=["0"]},{id="8",type="process",description="[kdevtmpfs]",user=\ "root",cores=["0"]},{id="154",type="process",description="[writeback]",user="root",cores=["0"]},{id=\ "156",type="process",description="[bioset]",user="root",cores=["0"]},{id="158",type="process",descri\ ption="[kblockd]",user="root",cores=["0"]},{id="187",type="process",description="[khubd]",user="root\ ",cores=["0"]},{id="202",type="process",description="[cfg80211]",user="root",cores=["0"]},{id="203",\ type="process",description="[kworker/0:1]",user="root",cores=["0"]},{id="292",type="process",descrip\ tion="[kswapd0]",user="root",cores=["0"]},{id="293",type="process",description="[fsnotify_mark]",use\ r="root",cores=["0"]},{id="294",type="process",description="[crypto]",user="root",cores=["0"]},{id="\ 398",type="process",description="[w1_bus_master1]",user="root",cores=["0"]},{id="414",type="process"\ ,description="[deferwq]",user="root",cores=["0"]},{id="419",type="process",description="[kworker/u2:\ 2]",user="root",cores=["0"]},{id="422",type="process",description="[mmcqd/0]",user="root",cores=["0"\ ]},{id="428",type="process",description="[jbd2/mmcblk0p2-]",user="root",cores=["0"]},{id="429",type=\ "process",description="[ext4-rsv-conver]",user="root",cores=["0"]},{id="430",type="process",descript\ ion="[ext4-unrsv-conv]",user="root",cores=["0"]},{id="545",type="process",description="udevd --daemo\ n",user="root",cores=["0"]},{id="660",type="process",description="udevd --daemon",user="root",cores=\ ["0"]},{id="661",type="process",description="udevd --daemon",user="root",cores=["0"]},{id="1549",typ\ e="process",description="[jbd2/mmcblk0p3-]",user="root",cores=["0"]},{id="1550",type="process",descr\ iption="[ext4-rsv-conver]",user="root",cores=["0"]},{id="1551",type="process",description="[ext4-unr\ sv-conv]",user="root",cores=["0"]},{id="1951",type="process",description="/usr/bin/dbus-daemon --sys\ tem",user="messagebus",cores=["0"]},{id="1992",type="process",description="dhclient -v -pf /run/dhcl\ ient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0",user="root",cores=["0"]},{id="2048",type=\ "process",description="/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf",user="www-data",cores=["0"\ ]},{id="2049",type="process",description="/usr/bin/php-cgi",user="www-data",cores=["0"]},{id="2055",\ type="process",description="/usr/bin/php-cgi",user="www-data",cores=["0"]},{id="2059",type="process"\ ,description="/usr/bin/php-cgi",user="www-data",cores=["0"]},{id="2061",type="process",description="\ /usr/bin/php-cgi",user="www-data",cores=["0"]},{id="2078",type="process",description="/usr/bin/php-c\ gi",user="www-data",cores=["0"]},{id="2080",type="process",description="avahi-daemon: running [ariag\ 25.local]",user="avahi",cores=["0"]},{id="2081",type="process",description="/usr/bin/php-cgi",user="\ www-data",cores=["0"]},{id="2082",type="process",description="/usr/bin/php-cgi",user="www-data",core\ s=["0"]},{id="2083",type="process",description="avahi-daemon: chroot helper",user="avahi",cores=["0"\ ]},{id="2084",type="process",description="/usr/bin/php-cgi",user="www-data",cores=["0"]},{id="2128",\ type="process",description="/usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var/\ lib/shellinabox -p 4200 -u shellinabox -g shellinabox --user-css Black on White:+/etc/shellinabox/op\ tions-enabled/00+Black on White.css,White On Black:-/etc/shellinabox/options-enabled/00_White On Bla\ ck.css;Color Terminal:+/etc/shellinabox/options-enabled/01+Color Terminal.css,Monochrome:-/etc/shell\ inabox/options-enabled/01_Monochrome.css -s/:LOGIN -t --no-beep",user="shellinabox",cores=["0"]},{id\ ="2129",type="process",description="/usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid \ -c /var/lib/shellinabox -p 4200 -u shellinabox -g shellinabox --user-css Black on White:+/etc/shelli\ nabox/options-enabled/00+Black on White.css,White On Black:-/etc/shellinabox/options-enabled/00_Whit\ e On Black.css;Color Terminal:+/etc/shellinabox/options-enabled/01+Color Terminal.css,Monochrome:-/e\ tc/shellinabox/options-enabled/01_Monochrome.css -s/:LOGIN -t --no-beep",user="shellinabox",cores=["\ 0"]},{id="2130",type="process",description="startpar -f -- shellinabox",user="root",cores=["0"]},{id\ ="2143",type="process",description="/usr/sbin/sshd",user="root",cores=["0"]},{id="2169",type="proces\ s",description="/sbin/getty 38400 tty1",user="root",cores=["0"]},{id="2170",type="process",descripti\ on="/sbin/getty 38400 tty2",user="root",cores=["0"]},{id="2171",type="process",description="/sbin/ge\ tty 38400 tty3",user="root",cores=["0"]},{id="2172",type="process",description="/sbin/getty 38400 tt\ y4",user="root",cores=["0"]},{id="2173",type="process",description="/sbin/getty 38400 tty5",user="ro\ ot",cores=["0"]},{id="2174",type="process",description="/sbin/getty 38400 tty6",user="root",cores=["\ 0"]},{id="2175",type="process",description="/sbin/getty -L ttyS0 115200 vt100",user="root",cores=["0\ "]},{id="2191",type="process",description="sshd: root@pts/2",user="root",cores=["0"]},{id="2193",typ\ e="process",description="/usr/lib/openssh/sftp-server",user="root",cores=["0"]},{id="2194",type="pro\ cess",description="/usr/lib/openssh/sftp-server",user="root",cores=["0"]},{id="2276",type="process",\ description="-bash",user="root",cores=["0"]},{id="2282",type="process",description="gdbserver :2345 \ /crossdev/helloworld/helloworld",user="root",cores=["0"]},{id="2285",type="process",description="/cr\ ossdev/helloworld/helloworld",user="root",cores=["0"]}] 844,795 20-list-thread-groups 844,795 (gdb) 844,800 &"Cannot access memory at address 0x0\n" 844,801 18^done,threads=[{id="1",target-id="Thread 2285",frame={level="0",addr="0xb6fda7c0",func="??\ ",args=[]},state="stopped",core="0"}] 844,801 (gdb) 844,808 19^done,value="4" 844,809 (gdb) 844,809 21-interpreter-exec --thread-group i1 console "show endian" 844,834 20^done,groups=[{id="i1",type="process",pid="42000",executable="/home/super/workspace/hellow\ orld/Debug-cross/helloworld",cores=["0"]}] 844,834 (gdb) 844,834 ~"The target endianness is set automatically (currently little endian)\n" 844,834 21^done 844,835 (gdb) 844,854 22-break-insert --thread-group i1 -f /home/super/workspace/helloworld/helloworld.c:12 844,859 22^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000084d8",func="m\ ain()",file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12",tim\ es="0",original-location="/home/super/workspace/helloworld/helloworld.c:12"} 844,860 (gdb) 844,884 23-break-insert --thread-group i1 -t -f main 844,889 23^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x000084d8",func="ma\ in()",file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12",time\ s="0",original-location="main"} 844,889 (gdb) 844,890 24-exec-continue --thread-group i1 844,905 24^running 844,906 *running,thread-id="all" 844,906 (gdb) 844,914 25remote get /proc/cpuinfo /tmp/org.eclipse.cdt.dsf.gdb.cpuinfo.13 845,030 =library-loaded,id="/usr/lib/arm-linux-gnueabi/libstdc++.so.6",target-name="/usr/lib/arm-lin\ ux-gnueabi/libstdc++.so.6",host-name="/usr/lib/arm-linux-gnueabi/libstdc++.so.6",symbols-loaded="0",\ thread-group="i1" 845,031 =library-loaded,id="/lib/arm-linux-gnueabi/libm.so.6",target-name="/lib/arm-linux-gnueabi/li\ bm.so.6",host-name="/lib/arm-linux-gnueabi/libm.so.6",symbols-loaded="0",thread-group="i1" 845,031 =library-loaded,id="/lib/arm-linux-gnueabi/libgcc_s.so.1",target-name="/lib/arm-linux-gnueab\ i/libgcc_s.so.1",host-name="/lib/arm-linux-gnueabi/libgcc_s.so.1",symbols-loaded="0",thread-group="i\ 845,031 =library-loaded,id="/lib/arm-linux-gnueabi/libc.so.6",target-name="/lib/arm-linux-gnueabi/li\ bc.so.6",host-name="/lib/arm-linux-gnueabi/libc.so.6",symbols-loaded="0",thread-group="i1" 845,031 =library-loaded,id="/lib/ld-linux.so.3",target-name="/lib/ld-linux.so.3",host-name="/lib/ld-\ linux.so.3",symbols-loaded="0",thread-group="i1" 845,031 &"warning: Could not load shared library symbols for 5 libraries, e.g. /usr/lib/arm-linux-gn\ ueabi/libstdc++.so.6.\nUse the \"info sharedlibrary\" command to see the complete listing.\nDo you n\ eed \"set solib-search-path\" or \"set sysroot\"?" 845,031 &"\n" 845,050 =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000\ 84d8",func="main()",file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",\ line="12",times="1",original-location="/home/super/workspace/helloworld/helloworld.c:12"} 845,051 =breakpoint-modified,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00008\ 4d8",func="main()",file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",l\ ine="12",times="1",original-location="main"} 845,070 *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x000084d8",func="main"\ ,args=[],file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12"},\ thread-id="1",stopped-threads="all",core="0" 845,072 =breakpoint-deleted,id="2" 845,072 (gdb) 845,072 &"remote get /proc/cpuinfo /tmp/org.eclipse.cdt.dsf.gdb.cpuinfo.13\n" 845,083 ~"Successfully fetched file \"/proc/cpuinfo\".\n" 845,084 25^done 845,084 (gdb) 845,099 26-list-thread-groups i1 845,102 26^done,threads=[{id="1",target-id="Thread 2285",frame={level="0",addr="0x000084d8",func="ma\ in",args=[],file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12\ "},state="stopped",core="0"}] 845,102 (gdb) 845,108 27-thread-info 1 845,111 27^done,threads=[{id="1",target-id="Thread 2285",frame={level="0",addr="0x000084d8",func="ma\ in",args=[],file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12\ "},state="stopped",core="0"}] 845,112 (gdb) 845,623 28-list-thread-groups 845,627 28^done,groups=[{id="i1",type="process",pid="42000",executable="/home/super/workspace/hellow\ orld/Debug-cross/helloworld",cores=["0"]}] 845,627 (gdb) 845,684 29-stack-info-depth --thread 1 11 845,684 29^done,depth="1" 845,684 (gdb) 845,868 30-stack-list-locals --thread 1 --frame 0 1 845,869 30^done,locals=[{name="a",value="0"}] 845,869 (gdb) 845,889 31-stack-info-depth --thread 1 845,890 31^done,depth="1" 845,890 (gdb) 845,891 32-var-create --thread 1 --frame 0 - * a 845,891 32^done,name="var1",numchild="0",value="0",type="int",thread-id="1",has_more="0" 845,892 (gdb) 850,863 33-interpreter-exec --thread-group i1 console kill 850,865 ~"Kill the program being debugged? (y or n) [answered Y; input not from terminal]\n" 850,865 =thread-group-exited,id="i1" 850,865 33^done 850,865 (gdb) 850,896 34-gdb-exit 850,897 34^exit 850,909 35-break-delete --thread-group i1 1I wouldn't worry about those just yet, if your debugging seems to work properly.[Updated on: Thu, 16 January 2014 15:28]
The first error seems to say you won't be able to debug dynamically loaded code, so unless you need that case, don't worry about it.
The second happens sometimes when GDB tries to access memory while the program is running. Since it only seems to happen at
the beginning in your case, it looks like things are good after and the debugging session will work properly.
Happy debugging!
Marc Khouzam wrote on Thu, 16 January 2014 10:50I wouldn't worry about those just yet, if your debugging seems to work properly.
The first error seems to say you won't be able to debug dynamically loaded code, so unless you need that case, don't worry about it.
The second happens sometimes when GDB tries to access memory while the program is running. Since it only seems to happen at
the beginning in your case, it looks like things are good after and the debugging session will work properly.
Happy debugging!
Thank you again, Marc, but seems I need sometimes to have a possibility of debugging a shared library, so the first problem looks like to be necessary to solve.
According to what I've managed to understand, to solve it I must copy the /usr from the board to a directory on the development PC and point the GDB to it adding "set sysroot /path/to/that/directory" to .gdbinit and this seems to do the job.
Is my theory right?P.S. maybe I should set "set sysroot remote:/" instead of "set sysroot /path/to/that/directory" ? That is more of a GDB question so I'm not the best person for that. But you should be able to find this on the net. Roman Reimche wrote on Mon, 20 January 2014 08:03[Updated on: Fri, 17 January 2014 16:31]
Thank you very much for your help, Marc.
by the way, adding "set sysroot remote:/" solved the problem. And now I have another one:
Function "internal_error" not defined. Function "info_command" not defined.
Trying to understand what's it about or where to get those functions. That's the relative part of the traces:
Previous Topic:Inspecting STL containers with GDB pretty print Next Topic:Launch eclipse session without executable Goto Forum:116,185 22-break-insert --thread-group i1 -f internal_error 116,185 23-break-insert --thread-group i1 -f info_command 116,186 24-break-insert --thread-group i1 -f /home/super/workspace/helloworld/helloworld.c:12 116,186 &"Function \"internal_error\" not defined.\n" 116,188 22^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending=\ "internal_error",times="0",original-location="internal_error"} 116,188 (gdb) 116,198 &"Function \"info_command\" not defined.\n" 116,198 23^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending=\ "info_command",times="0",original-location="info_command"} 116,198 (gdb) 116,199 24^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x000084d8",func="m\ ain()",file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12",tim\ es="0",original-location="/home/super/workspace/helloworld/helloworld.c:12"} 116,199 (gdb) 116,213 25-break-insert --thread-group i1 -t -f main 116,218 25^done,bkpt={number="4",type="breakpoint",disp="del",enabled="y",addr="0x000084d8",func="ma\ in()",file="../helloworld.c",fullname="/home/super/workspace/helloworld/helloworld.c",line="12",time\ s="0",original-location="main"}-=] Back to Top [=-[ Syndicate this forum (XML) ] [ ]Current Time: Sat Jun 22 17:59:06 GMT 2024Powered by FUDForum. Page generated in 0.04129 seconds