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 

questions about debug with psplink[solved]

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



Joined: 10 Nov 2007
Posts: 12

PostPosted: Sun Jan 06, 2008 1:03 am    Post subject: questions about debug with psplink[solved] Reply with quote

My psp is slim with 3.71m33-3

I have setted up the psplink
and then I run the usbhostfs_pc.exe on pc,and pspsh on pc
then I typed
Code:
debug xxx.elf

And start a new command window,typed
Code:
psp-gdb xxx.elf

and then
target remote localhost:10001

but I got this error
Quote:
(gdb) target remote localhost:10001
Remote debugging using localhost:10001
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response


So I changed the xxx.elf to xxx.prx
this time,it run well,but show like this
Code:
[New Thread 0]
0x088043ac in ?? ()
(gdb) l
No symbol table is loaded.  Use the "file" command.


I have already used -g in the makefile,but why this happened??
From the psplink_manual,it said that use debug program.elf, but this did't work.
Can anyone help me?


This question has been solved.
When using pspsh to debug your psp homebrew,you can debug prx file in pspsh and load elf file in psp-gdb


Last edited by coolspace on Fri Jan 11, 2008 3:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
coolspace



Joined: 10 Nov 2007
Posts: 12

PostPosted: Sun Jan 06, 2008 2:37 pm    Post subject: Reply with quote

Can anyone help me??
Or the psplinkusb does not work well on 3.71??
Or the psp-gdb can only debug elf files??

Compare the files that use -g option and don't use -g option, the only difference is elf file, but on 3.71, psplinkusb can't work well with elf file.
What can i do?
Back to top
View user's profile Send private message
snow



Joined: 15 Dec 2007
Posts: 31

PostPosted: Sun Jan 06, 2008 3:57 pm    Post subject: Reply with quote

Sorry, I'm somewhat newb material but I think I remember reading that you debug PRX files not ELFs? Put BUILD_PRX=1 into your makefile and rebuild. Try debugging against the PRX file that's generated.
Back to top
View user's profile Send private message
coolspace



Joined: 10 Nov 2007
Posts: 12

PostPosted: Sun Jan 06, 2008 4:05 pm    Post subject: Reply with quote

snow wrote:
Sorry, I'm somewhat newb material but I think I remember reading that you debug PRX files not ELFs? Put BUILD_PRX=1 into your makefile and rebuild. Try debugging against the PRX file that's generated.


I've done this.
BUILD_PRX=1 into my makefile
But the prx file don't have the debug info in it.
I think the debug info is in the elf file,but on 3.71, psplinkusb can't run elf file.
Back to top
View user's profile Send private message
snow



Joined: 15 Dec 2007
Posts: 31

PostPosted: Sun Jan 06, 2008 4:10 pm    Post subject: Reply with quote

Do a clean and build (if you haven't already). That's how I'm debugging and it works fine.
Back to top
View user's profile Send private message
coolspace



Joined: 10 Nov 2007
Posts: 12

PostPosted: Sun Jan 06, 2008 4:20 pm    Post subject: Reply with quote

snow wrote:
Do a clean and build (if you haven't already). That's how I'm debugging and it works fine.

yes,I'v typed "make clean" before i made the prx again.
Back to top
View user's profile Send private message
coolspace



Joined: 10 Nov 2007
Posts: 12

PostPosted: Sun Jan 06, 2008 4:26 pm    Post subject: Reply with quote

And this is my makefile

Code:
TARGET = test
OBJS = main.o file.o

BUILD_PRX = 1

PSP_FW_VERSION=371
INCDIR =
CFLAGS = -g -O2 -G0  -Wall -DDEVHOOK -DPSPFW3XX
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS =-lpspaudiocodec -lpspusb -lpspusbstor
LDFLAGS =
# -lpspglue -lpsplibc -lpsppower


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak


After I typed "debug test.prx" in pspsh,then I open a new cygwin window,and typed "psp-gdb test.prx".
But I got this message and i can't use list command

Quote:
This GDB was configured as "--host=i686-pc-mingw32 --target=psp"...
(no debugging symbols found)
(gdb) target remote localhost:10001
Remote debugging using localhost:10001
[New Thread 0]
0x08804300 in ?? ()
(gdb) list
No symbol table is loaded. Use the "file" command.
Back to top
View user's profile Send private message
F@T3oYCG



Joined: 06 Jul 2007
Posts: 7
Location: EUROPE, ENGLAND, WIDNESS

PostPosted: Sun Jan 06, 2008 9:44 pm    Post subject: Reply with quote

dont you have to use the windows cmd with psp link ???
_________________
-----F@T3oYCG-----
E-MAIL: fatboycg@hotmail.co.uk
PSP FAT VERSION HISTORY:
2.00 --> 2.50 --> 1.50 --> 2.00 --> 1.50 --> 3.40 OE-A --> 3.52 M33-4
PSP SLIM VERSION HISTORY:
3.60 -- 3.60 M33 --> 3.71 M33 --> 3.72 M33-2 --> 3.71 M33-4
Back to top
View user's profile Send private message Send e-mail MSN Messenger
coolspace



Joined: 10 Nov 2007
Posts: 12

PostPosted: Sun Jan 06, 2008 10:38 pm    Post subject: Reply with quote

F@T3oYCG wrote:
dont you have to use the windows cmd with psp link ???

I use msys instead of cygwin for psplinkusb and pspsh
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Mon Jan 07, 2008 12:30 am    Post subject: Reply with quote

I had the same problem.

In psplink, load the prx, but on your computer load the unstripped elf.

psplink ; debug xxx.prx
computer : psp-gdb xxx.elf

Say us if it worked.
Back to top
View user's profile Send private message
coolspace



Joined: 10 Nov 2007
Posts: 12

PostPosted: Fri Jan 11, 2008 3:08 pm    Post subject: Reply with quote

Cpasjuste wrote:
I had the same problem.

In psplink, load the prx, but on your computer load the unstripped elf.

psplink ; debug xxx.prx
computer : psp-gdb xxx.elf

Say us if it worked.

Thanks,it works fine
Back to top
View user's profile Send private message
snowsquirrel



Joined: 24 Feb 2008
Posts: 51

PostPosted: Thu Apr 03, 2008 6:39 am    Post subject: Reply with quote

This thread helped me in that it made me realized that I am supposed to call psp-gdb on the elf, not the prx.

But now, I get an error when I try to 'start' or 'run' the program.
Code:

d:\psp_project1\build\staged>psp-gdb debug_game_stripped.elf
GNU gdb 6.7.1
Copyright (C) 2007 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-mingw32 --target=psp"...
(gdb) target remote localhost:10001
Remote debugging using localhost:10001
[New Thread 0]
_start (args=0, argp=0x0) at crt0_prx.c:109
109     crt0_prx.c: No such file or directory.
        in crt0_prx.c
Current language:  auto; currently c
(gdb) start
Breakpoint 1 at 0x8806024: file src/main.cpp, line 47.
Starting program: d:\other_code\home_p4\psp_project1\build\staged/debug_game_stripped.elf
Don't know how to run.  Try "help target".
(gdb)


What am I doing wrong here?
~S
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