Support for GDB

The Uzebox now have a fully functional emulator! Download and discuss it here.

Re: Support for GDB

Postby filipe » Wed Jan 06, 2010 3:59 pm

Created the Emulator page in the wiki: http://uzebox.org/wiki/index.php?title=Emulator

--Filipe
User avatar
filipe
 
Posts: 29
Joined: Thu Dec 17, 2009 10:37 pm
Location: Cambridge, UK

Re: Support for GDB

Postby paul » Wed Jan 06, 2010 4:19 pm

filipe wrote:Created the Emulator page in the wiki: http://uzebox.org/wiki/index.php?title=Emulator

--Filipe


A comprehensive wiki entry - nice one, Filipe. I added a minor section for the Windows GUI for avr-gdb: avr-insight. It may be possible to connect from within AVRStudio also, but it wasn't readily apparent to me.
paul
 
Posts: 329
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: Support for GDB

Postby uze6666 » Wed Jan 06, 2010 5:01 pm

Thanks a lot Filipe, a wiki entry for the emulator was long due! Thanks again for your work on this. :mrgreen:

-Uze
User avatar
uze6666
Site Admin
 
Posts: 1550
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada

Re: Support for GDB

Postby filipe » Wed Jan 06, 2010 10:30 pm

Cool, I think now it's done! :P

-Filipe.
User avatar
filipe
 
Posts: 29
Joined: Thu Dec 17, 2009 10:37 pm
Location: Cambridge, UK

Re: Support for GDB

Postby uze6666 » Thu Jan 07, 2010 4:10 am

Hey Paul, you were successful compiling the emu under windows, but I keep getting errors like those. I'm not very familiar with GNU tool on Windows so any ideas?

Code: Select all
=================================
Building Debug...
Platform: Windows-Windows_NT
=================================
C:/MinGW/bin/g++ -c uzem.cpp -o Debug/uzem.o -march=native -mtune=native -IC:/MinGW/include/SDL -DWindows_NT -D_GNU_SOURCE=1 -DGUI=1 -g -MD -MP -MF Debug/uzem.d -DUSE_PORT_PRI
NT=1 -DUSE_SPI_DEBUG=1 -DUSE_EEPROM_DEBUG=1 -DUSE_GDBSERVER_DEBUG=1
uzem.cpp:1: error: bad value (native) for -march= switch
uzem.cpp:1: error: bad value (native) for -mtune= switch
make[1]: *** [Debug/uzem.o] Error 1
make: *** [all] Error 2


Btw, what exactly should be present in the C:/MinGW/include/SDL folder? the dll or include(s) or both?

Thanks

-uze
User avatar
uze6666
Site Admin
 
Posts: 1550
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada

Re: Support for GDB

Postby paul » Thu Jan 07, 2010 4:58 am

If your GCC version is prior to 4.2, then you will probably not have support for the -march=native option. You could try replacing native with i686 or whatever suits your ARCH. Try replacing this:

Code: Select all
######################################
# Architecture
######################################
ifeq ($(ARCH),)
    ARCH := native
    MTUNE := -mtune=native
endif


with this:

Code: Select all
######################################
# Architecture
######################################
ifeq ($(ARCH),)
    ARCH := i686
    MTUNE := -mtune=i686
endif


And yeah, you should only need includes in the SDL folder. I just throw the dll in the emu folder.
paul
 
Posts: 329
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: Support for GDB

Postby uze6666 » Thu Jan 07, 2010 5:10 am

Ah...shoot! The "lastest" Mingw version uses GCC 3.4.5 that indeed does not support those switches. I used your fix (thanks!) and that made it compile objects, however now I get this at link time:

...
C:/MinGW/bin/g++ Debug/uzem.o Debug/avr8.o Debug/uzerom.o Debug/gdbserver.o -o uzemdbg -IC:/MinGW/include/SDL -DWindows_NT -D_GNU_SOURCE=1 -DGUI=1 -lSDLmain -lSDL -lws2_3
2 -Wl,-u,_WinMain@16 -DUSE_PORT_PRINT=1 -DUSE_SPI_DEBUG=1 -DUSE_EEPROM_DEBUG=1 -DUSE_GDBSERVER_DEBUG=1
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lSDLmain
collect2: ld returned 1 exit status
make[1]: *** [uzemdbg] Error 1
make: *** [all] Error 2


I guess my SDL is not installed correctly. I created folder C:/MinGW/include/SDL and dumped in it all .h file from the SDL dev mingw32 tar. Is that it?

-Uze

EDIT: Ah! Man I'm quite rusty with GCC. :oops: OK I found it. I had to put the SDL libraries under c:\mingw\lib. It compiles just fine now and it works like a charm! Many thanks Filipe this is truly awesome, I can even debug assembler with the source files (that was *not* supported with AVR Studio)!!! I owe you a crate of Coca-Cola man! :D
User avatar
uze6666
Site Admin
 
Posts: 1550
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada

Previous

Return to Uzebox Emulator

Who is online

Users browsing this forum: No registered users and 1 guest