gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > [SOLVED] Can't remote debug elf target with GDB and VBA

#170567 - session13 - Fri Oct 02, 2009 5:08 pm

I'm trying to remote debug example file ansi_console from devkitpro examples using arm-eabi-gdb (devkitARM_r26/bin/arm-eabi-gdb) and VisualBoy Advance-1.7-SDL-linux-glibc22. My OS is Linux Ubuntu 9.04.

$ ./VisualBoyAdvance -Gtcp ansi_console.elf

output:
Code:
VisualBoyAdvance-SDL version 1.7
Linux version
Seaching for file VisualBoyAdvance.cfg
Searching current dir: /opt/devkitpro/VisualBoyAdvance-1.7-SDL-linux-glibc22
Reading configuration file.
Parsing debug info
Unknown block TAG 05
Unknown block TAG 05
Unknown block TAG 05
Seaching for file vba-over.ini
Searching current dir: /opt/devkitpro/VisualBoyAdvance-1.7-SDL-linux-glibc22
Seaching home directory: /home/special
Searching executable directory
vba-over.ini NOT FOUND (using emulator settings)
Listening for a connection at port 55555


$ /devkitpro/devkitARM/bin$ ./arm-eabi-gdb

output:
Code:
GNU gdb 6.8
Copyright (C) 2008 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 "--host=i586-pc-linux-gnu --target=arm-eabi".
(gdb)


$ target remote localhost:55555

output:
Code:
Remote communication error: Connection reset by peer.


output on VisualBoy Advance terminal:
Code:
Got a connection from 127.0.0.1 43239
ACK not received


Any help would be appreciated.


Last edited by session13 on Wed Oct 21, 2009 5:34 pm; edited 1 time in total

#170820 - session13 - Wed Oct 21, 2009 5:33 pm

gdb-7.0 compiled as --target=arm-elf work with VisualBoyAdvance-1.7-SDL-linux-glibc22.

Source
gdb-7.0 http://ftp.gnu.org/gnu/gdb/
VisualBoyAdvance-1.7-SDL-linux-glibc22 http://vba.ngemu.com/downloads.shtml
ham-271-linux-full http://www.aaronrogers.com/ham/downloads.php
arm-elf-gdb compiled from gdb-7.0 http://rapidshare.com/files/369117227/arm-elf-gdb.tar.gz
arm-elf-gdbtui compiled from gdb-7.0 http://rapidshare.com/files/369114531/arm-elf-gdbtui

Dependencies for compiling gdb can be found in gdb deb package
$ wget apt-get source gdb
$ nano gdb-6.8/debian/control


Dependencies for compiling GDB/Insight can be found in Insight deb package
$ wget apt-get source insight
$ nano insight--6.7.1.dfsg.1/debian/control


How to use arm-elf-gdbtui with vba through pipe
$ arm-elf-gdbtui
target remote | <path>/VisualBoyAdvance -Gpipe

file <file.elf> // load file to debug
load // upload program to vba

gdb options:
l // show source code
break <line_number> // set breakpoint
c // continue until breakpoint
n // next (step over)
s // step (step into)
quit // quit program

gdb, Stopping and Continuing http://sourceware.org/gdb/current/onlinedocs/gdb_6.html#SEC32
gdb, Examining Data http://sourceware.org/gdb/current/onlinedocs/gdb_11.html#SEC66

How to use arm-elf-gdb with Data Display Debugger 3.3.11 (ddd)
$ ddd --debugger <path>/arm-elf-gdb
In ddd/gdb console:
target remote | <path>VisualBoyAdvance -Gpipe
file <file.elf>
load


When vba window is active, press Esc to close remote connection or F11 to return to gdb command line.
Source: http://vba.ngemu.com/faq.shtml

How to use gdb/vba over tcp with Eclipse
http://forum.gbadev.org/viewtopic.php?t=5271