forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hello all. I'm new to PS2 development

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Sun Mar 04, 2007 4:48 am    Post subject: Hello all. I'm new to PS2 development Reply with quote

Hi all,

I recently bought a PS2 console in second hand at a nice price and become aware of the homebrew scene.

Using a boot disc (i'm not going to say here for avoiding advetising issues) and LaunchELF I already tried some great PS2 homebrew stuff like SMS player (great!), a sega, SNES and Amiga emulators, some demos.

I already got a precompiled toolchain for windows and compiled some stuff (some demos), booting them from a USB compatible pendrive and LaunchELF, of course.

Now I'm considering in buying a network adapter for the PS2 since as far I understood, it speeds up a lot the process of running code on PS2 over my current solution : saving to the pen drive, booting the PS2 with the disc, and repeating the whole process for the next .elf to execute is just to time consuming.

My big concern is about debugging. Yes, i'm not the best programmer of the world for sure and I make a lot of bugs, specially in C :)

Debbuging on the PS2 is a drag, isn't it ? Even with the network utilities I have the impression that ins't possible to trace the C source during debugging, only catch the exceptions and locate the error over the native code ... Am I wrong ?

Well, i'm a bit too spoiled by modern debugging systems for the PC, i guess.

I would like to hear from you some advice, specially regarding the debugging matter.

Thanks
Back to top
View user's profile Send private message Visit poster's website
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Sun Mar 04, 2007 5:07 am    Post subject: Reply with quote

when exception occurs on ee side you get address in native code yes.
(for example 0x10010a)

but if you compiled with -g, you can use this to find source line number :

addr2line -e prog.elf 10010a

it will display :
"module name: line number"

so, it's ok... not so hard to debug
Back to top
View user's profile Send private message
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Sun Mar 04, 2007 7:46 am    Post subject: Reply with quote

Hi ps2devman,

I already have read something like that on
http://lukasz.dk/programming/playstation-2/ps2link-debugging/

But I wonder if it's possible to, for example, get the contents of variables and such things usually done during debugging, at debug time (stepping though, etc)

My impression is that isn't possible.
Well, I could be worst...
Back to top
View user's profile Send private message Visit poster's website
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Sun Mar 04, 2007 5:48 pm    Post subject: Reply with quote

Maybe try ps2gdb (I've never tried it myself).
You can download it with this command under cygwin:
svn checkout svn://svn.pspdev.org/ps2/trunk/ps2gdb


The Readme of ps2gdb says this :

INTRODUCTION
----------------------------------------------------------------------------

ps2gdbStub is a tcp stub for the gnu debugger. It could be easily changed
to not use tcp. The low level portion reads 128 bits for the 32 gprs and
also for lo and hi, although these are converted down to 32 bits before
sending to the remote GDB.

Currently, the code *must* be uploaded via pukklink or ps2link. Naplink
won't do it!

As for building the remote GDB, I configured gdb as mips-idt-elf and hacked
about with it a bit. I managed to get the latest weekly snapshot (which at
time of writing was gdb+dejagnu-20030801.tar.bz2) to work, after some hacking
around. I've included a .cmd file for use with the remote GDB. You'll need
to change the target line with the correct IP of your ps2. To invoke, from
the shell, type <gdb -x ps2.cmd>

With reference to the frame pointer, gpr $30 should be the frame pointer,
this is what the MIPS abi says anyway. However, our toolchain appears to use
grp $30 as another saved register (s8), so I just report the fp to be the
same as the sp at the moment.


COPYRIGHT FOR PS2GDBSTUB
----------------------------------------------------------------------------

Copyright (c) 2003 Ray Donnelly (rdonnelly@polygoons.com)
All rights reserved.
Back to top
View user's profile Send private message
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Sun Mar 04, 2007 9:11 pm    Post subject: Reply with quote

Thanks for the tip, again.
It seems nice :)

I'll check it as soon I buy the network adapter.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group