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 

How to debug with PSPLINK? TyRaNiD - HELP!

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



Joined: 08 Feb 2007
Posts: 155

PostPosted: Sun Apr 11, 2010 7:07 am    Post subject: How to debug with PSPLINK? TyRaNiD - HELP! Reply with quote

Here goes my work...

I've created a ISO with a usermode homebrew as EBOOT.BIN, so I wanted to know how I'd go and debug that with PSPLINK (by loading it as a plugin).

It's mostly about the usual printf... I need to log some debug messages in a quick and easy way...

Right now I'm using a handcrafted debuglog function which outputs to memory stick in a logfile... but sadly this is too slow for my needs... cause some functions timeout due to the long flush rates...

Ive tried with sceKernelPrintf and Kprintf (which doesnt work in usermode btw...) >_>

So I wanna know from you experts,... just how do I have to code my program so I can directly output into the PSPLink USB Shell?

I need this desperately cause I don't know how I'm ment to speed up the logging process otherwise and still make PROPER use of it...
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
arnie



Joined: 11 Apr 2009
Posts: 16

PostPosted: Sun Apr 11, 2010 9:27 am    Post subject: Reply with quote

I thought you could just use pspdebug library and then do a pspDebugScreenPrintf. PSPLink should pick it up and display it on the shell.

-Arnie
Back to top
View user's profile Send private message
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Sun Apr 11, 2010 6:42 pm    Post subject: Reply with quote

Sadly I cannot use the debugscreen... as the tool is running next to a retail game...

The new handcrafted EBOOT loads and starts the retail game... thus the retail game picks the screen up making the debugscreen unuseable...
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Sun Apr 11, 2010 10:08 pm    Post subject: Reply with quote

Years ago i have made a printf like function over udp for the psp if you are interested i can
take a look in my old backups. The client displaying the result of the debug of the psp was written in java and was running on my pc

I have choosen udp because even at high rate of debug messages the only think that can happen is the drop of 1 or 2 messages
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Sun Apr 11, 2010 10:52 pm    Post subject: Reply with quote

That would be nice to have but there HAS to be a way to do it in PSPLINK, afterall I've been able to capture several messages from retail games like Wild Arms: Crossfire.
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Mon Apr 12, 2010 5:53 am    Post subject: Reply with quote

Code:
#define PSPLINK_OUT 2

sceIoWrite(PSPLINK_OUT, description, strlen(description));

_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Mon Apr 12, 2010 7:59 am    Post subject: Reply with quote

Sir you rule... amen.
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Tue Apr 13, 2010 12:28 am    Post subject: Reply with quote

Didn't work... :(

No output at all in pspsh... sadly...
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Tue Apr 13, 2010 3:13 am    Post subject: Reply with quote

Normaly the handle with value of 2 is stderr

Value 0 = stdin Value 1 = stdout and Value of 2 = stderr
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Tue Apr 13, 2010 6:18 am    Post subject: Reply with quote

I will give a value of 1 a test lateron, but shouldn't stderr display in pspsh too? :(
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Wed Apr 14, 2010 6:34 am    Post subject: Reply with quote

Okay, posting my POSITIVE results here...

1. Works with sceIoWrite(1, buffer, strlen(buffer));
2. Only works with pcterm tool, not with pspsh.

Thanks for all the help guys! ^^

Sadly it misses some early on debugging messages... I guess PSPLink isn't loaded fast enough to capture those, but otherwise it's working very well now.
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Thu Apr 15, 2010 8:03 am    Post subject: Reply with quote

Works perfectly for me with file descriptor 2. Maybe it's a Windows issue with the drivers needed for PSP Type B. In Linux it works absolutely fine. Could also be because I remember you said you didn't use usbhostfs.prx.
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Thu Apr 15, 2010 4:13 pm    Post subject: Reply with quote

Stdout and Stderr output in pspsh work for me on Win7 64 and XP. Also, you have to use psplink.prx, not usbhostfs.prx as plugin for debugging with psplink.
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Fri Apr 16, 2010 5:13 am    Post subject: Reply with quote

Yeah, psplink.prx is pretty obvious. I mean I use both of them. If you only use psplink.prx, then obviously that's not why it's not working for Coldbird.
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Fri Apr 16, 2010 5:56 am    Post subject: Reply with quote

I think you are only seeing stdout messages because you are not using pspsh, but pcterm.

Usbhostfs_pc listens on port 10000 to 10003 for connections and outputs stdout on 10002 and stderr on 10003. You can only connect to one of the ports with a terminal program.

m0skit0: When I wrote this I was under the impression that you could load either usbhostfs.prx or psplink.prx, but I was wrong. Both can be enabled at the same time, doesn't make a difference for me.
Back to top
View user's profile Send private message
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Sun Apr 18, 2010 8:27 pm    Post subject: Reply with quote

To move some things into the right direction:

1. Im using Linux, you can't be serious about using PSPLink on Windows... urgh...

2. I know how PSPLink forwards the specific messages as I usually spend a lot of time trying to figure things out myself before I ask on these forums.

3. The reason I did ask in the end was because even though all seemed fine it didn't work... pspsh simply didnt display the thing even though the connection was up and working.

I don't know what is the cause of it not working with pspsh for me, but as it's working in pcterm I'm not bothered by the problem anymore.
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Apr 19, 2010 2:54 am    Post subject: Reply with quote

I have no idea why it wouldn't work, although the stdio stuff in the kernel has done some odd things along the line, for example they broken fdprintf at one point and I think the kernel libc printf uses that, so that might explain something. You could try using Kprintf and the usbkprintf driver from psplinkusb's tools directory which probably will still work, maybe ;)
Back to top
View user's profile Send private message
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Mon Apr 19, 2010 4:16 am    Post subject: Reply with quote

Kprintf is no option as the homebrew app Im using is a usermode homebrew...

To use that I'd have to create a kernel wrapper module re-exporting it as a syscall for user calling...

I got it working with sceIoWrite + Stdout + pcterm afterall... so Im happy. :D
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Wed Apr 21, 2010 9:02 am    Post subject: Reply with quote

I guess you're running pspsh with root permissions, right?
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Fri Apr 23, 2010 12:39 am    Post subject: Reply with quote

m0skit0 wrote:
I guess you're running pspsh with root permissions, right?

No, but I figured out why pcterm was the only thing working.
I still had the pcterm=1 flag in the psplink.ini file.
Removing it made the thing work with pspsh.
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP 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