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 

cannot get psplink and psp-gdb to work

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



Joined: 12 Feb 2007
Posts: 57
Location: Sofia

PostPosted: Mon Nov 16, 2009 9:07 am    Post subject: cannot get psplink and psp-gdb to work Reply with quote

Hi,

first, I must say that I made a seach on all the threads, and found many with my same problem, althou following their instructions didn't help me... here I go:
First, must say that I use a Fedora 7 box, downloaded and built the toolchain few days ago, use a PSP 1001 with CFW 5.00 M33-6.
I compile with the -g and -O0 flags, MAKE_PRX=1 and linking the relevant build_prx.mak file.
All works fine if I make an EBOOT.PBP and load it, either on the PSP, or by ./EBOOT.PBP in the psplink shell.

1. I run PSPLink v3.0 OE on my PSP
2. on a terminal I run usbhostfs_pc -t 100, and get the following:
USBHostFS (c) TyRaNiD 2k6
Built Nov 11 2009 16:04:22 - $Revision: 2368 $
Connected to device
3. on another terminal I run pspsh, and on the usbhostfs_pc terminal, I can see the following:
Accepting async connection (0) from 127.0.0.1
Accepting async connection (2) from 127.0.0.1
Accepting async connection (3) from 127.0.0.1
4. on the pspsh terminal, I type debug ./helloworld.prx, and get the following:
PSPLink USB GDBServer (c) 2k7 TyRaNiD
host0:/> Loaded host0:/helloworld.prx - UID 0x03B45F59, Entry 0x08804300
just to make sure, I set "gdbdebug on" in the usbhost temrinal.
Then I am supposed to run, in a new terminal, psp-gdb ./helloworld.elf ()
now, I am supposed to launch psp-gdb ./helloworld.elf, then the target thing..., which shows the following:
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=i686-pc-linux-gnu --target=psp"...
(gdb) target remote localhost:10001
Remote debugging using localhost:10001
[New Thread 0]
exit_callback (arg1=Cannot access memory at address 0xffffffe8
) at main.cpp:16
16 int exit_callback(int arg1, int arg2, void *common)
(gdb)

...

if I type c, it shows only "Continuing." and then nothing happens, no prompt, no actions.

if, OTOH, I type start, it shows the following:
Breakpoint 1 at 0x88043c8: file main.cpp, line 44.
Starting program: /home/batman/Projects/PSP/HelloWorld/helloworld.elf
Don't know how to run. Try "help target".
after this I can type c, and it behaves like I described above in case of directly type c.

Can anybody help me have this to run properly?

P.S.
The program is just a basic helloworld, with the setupcallbacks thing, etc.

Thank you,
A.
Back to top
View user's profile Send private message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Tue Nov 17, 2009 12:30 am    Post subject: Reply with quote

Are you using a old version SDK?
_________________
Code:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
Alberto



Joined: 12 Feb 2007
Posts: 57
Location: Sofia

PostPosted: Tue Nov 17, 2009 12:39 am    Post subject: Reply with quote

jojojoris wrote:
Are you using a old version SDK?


I told you I downloaded few days ago, maybe on the 11th.
From svn co svn.ps2dev.org/psp/trunk/psptoolchain.

The program works, as I say; I just cannot debug it.
I have seen in other threads (while looking for a solution) that usually the debugger stops in crt0, in the _start thing... while for me it jumps directly far ahead...

Anybody can just post here the simplest helloworld and its makefile to compile it for the debugger, so that I can check it agains mine, and possibly exclude the possibility that the problem is in the toolchain/SDK?

TIA
A.
Back to top
View user's profile Send private message
Alberto



Joined: 12 Feb 2007
Posts: 57
Location: Sofia

PostPosted: Tue Nov 17, 2009 7:20 am    Post subject: Reply with quote

ok,

say that after thinking on what I last wrote, I found that leaving MAKE_PRX = 1 in the Makefile, and including build.mak (instead of build_prx.mak, which seems obvious) I got something working... ;-)

Now the program stops inside _start, correctly. Then I just set a breakpoint at the beginning of main, with break main, and finally I can do c-ontinue, and various n-ext. Also until <line number> works fine.

Now the question is: how should the behavior of gdb be, when reaching the end of the program? I mean, if I have the setupcallbacks thing, I can (almost) end the program, but the program actually doesn't terminate (it hangs on the "plaease wait" sony system screen) and gdb is hung too (no prompt whatsoever).
It seems that the call to sceKernelExitGame() hangs it. Indeed if I terminate the program without the HOME button press, but instead have a loop on button presses, once I terminate all, and finally reach the sceKernelExitGame() call, the program exits, psplink resets (this is correct) but gdb still hungs, and I have to kill it somehow (almost always with ctrl-c a couple of times after resetting pspsh, then "y" and "quit")

Any enlightment on these issues?

Cheers, A.
Back to top
View user's profile Send private message
Alberto



Joined: 12 Feb 2007
Posts: 57
Location: Sofia

PostPosted: Tue Nov 17, 2009 7:23 am    Post subject: Reply with quote

Alberto wrote:

say that after thinking on what I last wrote, I found that leaving MAKE_PRX = 1 in the Makefile, and including build.mak (instead of build_prx.mak, which seems obvious) I got something working... ;-)


forgot to say that in this case I don't get any *.prx, but only the *.elf, which can be (to my surprise) loaded into pspsh with the debug statement... and I can confirm it works... Am I the only one??? Have I dioscovered a strange -thou beautifule, to some extent- behavior of the whole system?

Again, cheers, A.
Back to top
View user's profile Send private message
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