View Full Version : pSX Debugger
JoKyR
February 25th, 2006, 18:05
For the life of me, I can't figure out how to use the pSX Debugger. I'm pretty well versed in MIPS code, but I can't seem to get the debugger to view the code that's actually being executed. Also, is there a way to jump to different offsets easily, or single step through the code?
Any tips or suggestions would be greatly appreciated. :)
pSXAuthor
March 1st, 2006, 20:18
First of all open the debugger and select Window/Tile horizontal (the windows start out stacked on top of each other - I've never bothered to fix this 'cos I'm too lazy!)
Next break the CPU (Debug/Break).... now you can single step by highlighting the disassembly window and pressing F8 (step over) or F7 (step into), or by using the Debug menu.
The thing is though "the code that's actually being executed" is a very fuzzy thing - LOTS of code gets executed every frame in an average PS1 game. Debug/Break usually ends up breaking the CPU near vblank so its often in the interrupt handler (or at 0x80 which is the interrupt vector).
You'll need to know more about the program you are trying to debug...
(its exactly like breaking Windows and expecting PC to be pointing at a bit of code you are trying to debug... ain't gonna happen!)
If you know the address of the code you want to single step through place a breakpoint there (right click on the breakpoint window and select Add), or use F6 (run to cursor). If you know a memory location that the code you are interested in reads/writes add a memory breakpoint (again, right click the breakpoint window and select Add.... select Memory, tick read and write as necessary, enter the address and size of the region you want to break on). Breakpoints also support condition expressions (eg. r2==0x123456), these also support a few functions like read_long(..addr...) but I haven't documented them anywhere.
JoKyR
March 11th, 2006, 17:12
pSX Author,
Thanks for your help, but it still doesn't seem to be working like you described.
So, I start the game, and it's working fine. I open the debugger and break the program.
First, the interface to set a breakpoint is confusing me. There's a box for size. Is it asking for the size of the data section in bits or bytes?
Ignoring this for the moment, I enter an address (800B88CC) set it to "Memory," "read" and "write" are already checked, so I hit "ok." But then, when the breakpoint appears in the list, it doesn't say the address. It says "v00000320 - 0000031F". Am I missing something? Once the breakpoint is set, there doesn't seem to be a way to edit it, other than deleting and creating a new one.
But then, when I hit "Run" the program says its running, but the game is frozen.
Am I doing something wrong?
pSXAuthor
March 21st, 2006, 01:39
pSX Author,
Thanks for your help, but it still doesn't seem to be working like you described.
So, I start the game, and it's working fine. I open the debugger and break the program.
First, the interface to set a breakpoint is confusing me. There's a box for size. Is it asking for the size of the data section in bits or bytes?
This is for memory breakpoints - it sets the size of the memory range to break on in bytes. So, for example, if you entered 0x80010000 for address, then put 8 for size it would break if a memory read/write occurs within the range 0x80010000-0x80010007.
Ignoring this for the moment, I enter an address (800B88CC) set it to "Memory," "read" and "write" are already checked, so I hit "ok." But then, when the breakpoint appears in the list, it doesn't say the address. It says "v00000320 - 0000031F". Am I missing something?
To use hex you need to enter the address as "0x800b88cc". That might be your problem. The v refers to the emulators "virtual" address space - you can ignore that when setting breakpoints in the PS1's RAM though (this mainly comes into play on other consoles - the debugger is cross [emulated] platform).
Once the breakpoint is set, there doesn't seem to be a way to edit it, other than deleting and creating a new one.
Yeah, sorry - there is no way to edit breakpoints at the moment (I'll get around to it one day!).
But then, when I hit "Run" the program says its running, but the game is frozen.
Am I doing something wrong?
I'm not sure.... it might be because you set that breakpoint above in a very low area of memory...
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.