Page 1 of 1

line-by-line debugging possibility

Posted: November 5th, 2013, 8:50 am
by Yagotzirck
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

Re: line-by-line debugging possibility

Posted: November 5th, 2013, 2:37 pm
by t0rxe
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.

Re: line-by-line debugging possibility

Posted: November 6th, 2013, 1:15 am
by Yagotzirck
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 :?:

Re: line-by-line debugging possibility

Posted: November 7th, 2013, 9:56 am
by jman
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?

Re: line-by-line debugging possibility

Posted: November 7th, 2013, 10:29 am
by Yagotzirck
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

Re: line-by-line debugging possibility

Posted: November 7th, 2013, 3:20 pm
by t0rxe
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.

Re: line-by-line debugging possibility

Posted: November 7th, 2013, 11:33 pm
by Yagotzirck
let us know if you figure something out, I might get an xplorer fx/gameshark cartridge as well :)

Re: line-by-line debugging possibility

Posted: November 8th, 2013, 6:24 pm
by t0rxe
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.