line-by-line debugging possibility

General help for the PSY-Q SDK, such as setting the SDK up, compiling correctly, linking and debugging
Post Reply
Yagotzirck
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 131
Joined: Jul 17, 2013

line-by-line debugging possibility

Post by Yagotzirck » November 5th, 2013, 8:50 am

Is there any chance to do C code line-by-line debugging (possibly with emulators such as no$psx), or printf() calls are the closest thing to achieve a debugging environment? ccpsx comes with a -g option but I have no clue about how to use that... was it meant for specific hardware like DTL-H2000 or it can be used in some other ways as well?
Thanks in advance

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » November 5th, 2013, 2:37 pm

I've actually thought about this, and I noticed that the PC compiles on itself and runs on itself, whereas the PlayStation compiles on the PC and runs on itself, so live debugging isn't possible without some sort of 'step by step' I/O check procedure. I just use the printf() function where and when I need to debug things. If you use NO$PSX, you can use the printf() command, but if you're on a real console, a serial cable works great for debugging as the printf() command gets sent over it once AddSIO() is initialised.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

Yagotzirck
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 131
Joined: Jul 17, 2013

Post by Yagotzirck » November 6th, 2013, 1:15 am

Alright, printf it is then. Still curious about for what kind of debugging -g parameter is intended though, since the interactive one isn't possible :?:

jman
Rookie Programmer
Rookie Programmer
Posts: 110
Joined: Aug 13, 2013

Post by jman » November 7th, 2013, 9:56 am

Just out of curiosity (didn't check myself yet).

scee_dev.pdf, page 13 and following: "3.1.2b DBUGPSX".

They talk about this debugger for PC-based development but don't get into details. Could it be a useful tool?

Yagotzirck
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 131
Joined: Jul 17, 2013

Post by Yagotzirck » November 7th, 2013, 10:29 am

I've digged a bit more about this, and found this excerpt from the psy-q documentation cd(DEVREFS/PSYQ2.PDF more precisely):
Psy-Q offers Source Level Debugging. This allows you to step, trace, set
breakpoints, etc. in your original C or Assembler source code. The system
automatically and invisibly, handles multiple text files.
The sad part is that the included debugger seems to work only with pieces of hardware like DTL-S510B(a SCSI card linked with psx PIO), or the boards DTL-H2000/DTL-H2500, so it's most likely useless nowadays :(
If someone with enough experience/patience writes a C/C++ debugger that interprets debugging symbols produced with -g parameter while being linked with an emulator/real psx without having to buy rare and expensive hardware relics, that would be great. But I honestly don't see that happening

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » November 7th, 2013, 3:20 pm

I too was looking at DBUGPSX last night actually :P
It's in the Psy-Q BIN folder and is part of the environment variables, so it can be called from anywhere, but we can't use it. I'm sure there is probably a way to debug with CAETLA. I will look into it.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

Yagotzirck
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 131
Joined: Jul 17, 2013

Post by Yagotzirck » November 7th, 2013, 11:33 pm

let us know if you figure something out, I might get an xplorer fx/gameshark cartridge as well :)

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » November 8th, 2013, 6:24 pm

I didn't find anything for CAETLA. The closest thing I found was that you can download the RAM. The only way to debug at the moment is with SN Systems DBUGPSX.EXE on official development hardware. I'm sure the program could be cracked to work with CAETLA though by someone, but it would be difficult. It would be easier for them to code a new one from scratch. Another option is to just use NO$PSX. This has a straight up debugger on start, but there isn't a 'live' step by step C code debugger like DBUGPSX states it offers.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests