Support for GDB

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

Re: WIP: Support for GDB

Postby paul » Mon Jan 04, 2010 2:46 pm

Thanks, Filipe! It's working great and soooo helpful. I have it working on Windows after a few changes. I'll make a patch tomorrow and upload it.

Thanks again :mrgreen:
paul
 
Posts: 329
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: WIP: Support for GDB

Postby paul » Mon Jan 04, 2010 10:08 pm

This patch should be applied to the original rev-beta5 checkout (i.e. without the earlier patches). It should work for both Windows and Linux (haven't tested Mac). I only tested briefly on Ubuntu 9.10 and XP. Filipe, you may want to try it yourself before adding it to the download section.

For windows users: the makefile defaults SDL_FLAGS to C:/MinGW/include/SDL. You may need to point this to the correct path. It would be nice if anyone knows a windows solution similar to the $(shell sdl-config --cflags) that Linux has, but it's not a huge deal.

I'm not super-familiar with the patch tool, so if you can get the size of the patch down, that'd be good (although it is an insignificant download either way).
Attachments
patch-uzem-gdb-xplatform.zip
(59.2 KiB) Downloaded 4 times
paul
 
Posts: 329
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: WIP: Support for GDB

Postby filipe » Tue Jan 05, 2010 5:11 pm

Paul,
The patch got big because your editor converted the DOS line endings to Unix style, so the diff thinks the full file changed.
About the SDL_QUIT, I was wondering why it didn't work for Windows then I noticed that I forgot to check if SDL_EventPoll() is returning a valid event. Maybe this is why it didn't work for you. I fixed that and would be nice if you can make a final test to see if it works now, so I can commit it.

Note: I updated the patch on the original post.

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

Re: WIP: Support for GDB

Postby paul » Tue Jan 05, 2010 6:02 pm

filipe wrote:Paul,
The patch got big because your editor converted the DOS line endings to Unix style, so the diff thinks the full file changed.
About the SDL_QUIT, I was wondering why it didn't work for Windows then I noticed that I forgot to check if SDL_EventPoll() is returning a valid event. Maybe this is why it didn't work for you. I fixed that and would be nice if you can make a final test to see if it works now, so I can commit it.

Note: I updated the patch on the original post.

Filipe.


Ahh, of course - the line endings.

The only change needed in your latest patch is in the Windows specific region of the Makefile. You left out the winsock2 libs:

Code: Select all

-LDFLAGS += -Wl,-u,_WinMain@16
+LDFLAGS += -lws2_32 -Wl,-u,_WinMain@16



Otherwise, it's all good.
paul
 
Posts: 329
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: WIP: Support for GDB

Postby paul » Tue Jan 05, 2010 6:50 pm

Btw, since I'm not too familiar with the command line version, does the GDB GUI works too?? That would be the cream of the crop!


Windows has avr-insight. It's in the WinAVR distribution. You'll need your paths set correctly:

Code: Select all
avr-insight -x gdb-script.cfg Arkanoid.elf


Run from within the Arkanoid demo's default folder, of course. I'm not sure if there is a Linux equivalent. You'll need the emulator running in debug mode before you start insight (at least I'm not familiar with how to connect otherwise).
paul
 
Posts: 329
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: WIP: Support for GDB

Postby filipe » Tue Jan 05, 2010 9:32 pm

You left out the winsock2 libs

Oops! :roll:

I'm not sure if there is a Linux equivalent.

Yes:
insight - I still didn't tried
ddd - It worked with the basic stuffs but crashed when I tried to open an assembly file (and is bloody ugly).
kdbg - Very good! If you are running Linux with KDE, don't think twice.
Finally there are the debuggers embedded in editors, like eclipse and Avr-Studio (it supports GDB, right?)

About the patch, it is already on the repository (rev 109) and I sent a new 'featured download' to Googles' page.
User avatar
filipe
 
Posts: 29
Joined: Thu Dec 17, 2009 10:37 pm
Location: Cambridge, UK

Re: Support for GDB

Postby uze6666 » Tue Jan 05, 2010 10:33 pm

About the patch, it is already on the repository (rev 109) and I sent a new 'featured download' to Googles' page.

Great work guys! If someone could wrap up some wiki page about how to install/set up/use it that would greatly help others (like me ;) ). I'll post a news entry tonight about this.

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

Re: Support for GDB

Postby uze6666 » Tue Jan 05, 2010 11:22 pm

Oh, I noticed, the emulator version should be updated to reflect the support for GDB. "Interestingly" the source shows 1.08, but the previous compiled version is 1.09?? Anyhow I propose we set it to 1.10 to avoid any further confusion in the future.

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

Re: Support for GDB

Postby filipe » Wed Jan 06, 2010 12:27 am

I forgot to check any version counter :(
This version is supposed to be in sync with the SVN revision ? Or it was just a coincidence Uzem 1.08 be in SVN revision 108 ?

Actually I have more doubts about revisions, branches, releases, etc... I will start a new thread so we can discuss it.

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

Re: Support for GDB

Postby uze6666 » Wed Jan 06, 2010 2:05 am

Or it was just a coincidence Uzem 1.08 be in SVN revision 108 ?

A pure coincidence!
Actually I have more doubts about revisions, branches, releases, etc... I will start a new thread so we can discuss it.

I totally agree with you, it's a bit messy right now. However, I'd like to merge everything back in the trunk since the code is pretty solid now...

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

PreviousNext

Return to Uzebox Emulator

Who is online

Users browsing this forum: No registered users and 1 guest