questions about debug with psplink[solved]

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

questions about debug with psplink[solved]

Post by coolspace »

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: Select all

debug xxx.elf
And start a new command window,typed

Code: Select all

psp-gdb xxx.elf
and then
target remote localhost:10001

but I got this error
(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: Select all

[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.
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

Post by coolspace »

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?
snow
Posts: 31
Joined: Sat Dec 15, 2007 12:34 pm

Post by snow »

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.
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

Post by coolspace »

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.
snow
Posts: 31
Joined: Sat Dec 15, 2007 12:34 pm

Post by snow »

Do a clean and build (if you haven't already). That's how I'm debugging and it works fine.
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

Post by coolspace »

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.
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

Post by coolspace »

And this is my makefile

Code: Select all

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
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.
F@T3oYCG
Posts: 7
Joined: Fri Jul 06, 2007 8:00 pm
Location: EUROPE, ENGLAND, WIDNESS

Post by F@T3oYCG »

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
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

Post by coolspace »

F@T3oYCG wrote:dont you have to use the windows cmd with psp link ???
I use msys instead of cygwin for psplinkusb and pspsh
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

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.
coolspace
Posts: 12
Joined: Sat Nov 10, 2007 5:45 pm

Post by coolspace »

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
snowsquirrel
Posts: 51
Joined: Sun Feb 24, 2008 3:36 am

Post by snowsquirrel »

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: Select all

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+&#58; GNU GPL version 3 or later <http&#58;//gnu.org/licenses/gpl.html>
This is free software&#58; 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"...
&#40;gdb&#41; target remote localhost&#58;10001
Remote debugging using localhost&#58;10001
&#91;New Thread 0&#93;
_start &#40;args=0, argp=0x0&#41; at crt0_prx.c&#58;109
109     crt0_prx.c&#58; No such file or directory.
        in crt0_prx.c
Current language&#58;  auto; currently c
&#40;gdb&#41; start
Breakpoint 1 at 0x8806024&#58; file src/main.cpp, line 47.
Starting program&#58; d&#58;\other_code\home_p4\psp_project1\build\staged/debug_game_stripped.elf
Don't know how to run.  Try "help target".
&#40;gdb&#41;
What am I doing wrong here?
~S
Post Reply