Emuforums.com

Go Back   Emuforums.com > PSX Emulation > pSX Discussion
Register FAQ Members List Calendar Mark Forums Read

Login to remove all ads!
Reply
 
LinkBack Thread Tools Display Modes
Old February 25th, 2006   #1 (permalink)
Registered User
 
Join Date: Feb 2006
Location: Salt Lake City, Ut
Posts: 6
pSX Debugger

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.
JoKyR is offline   Reply With Quote
Old March 1st, 2006   #2 (permalink)
Emu author
 
Join Date: Jan 2006
Location: In my house
Posts: 48
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.
pSXAuthor is offline   Reply With Quote
Old March 11th, 2006   #3 (permalink)
Registered User
 
Join Date: Feb 2006
Location: Salt Lake City, Ut
Posts: 6
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?
JoKyR is offline   Reply With Quote
Old March 21st, 2006   #4 (permalink)
Emu author
 
Join Date: Jan 2006
Location: In my house
Posts: 48
Quote:
Originally Posted by JoKyR
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.

Quote:
Originally Posted by JoKyR
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).

Quote:
Originally Posted by JoKyR
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!).

Quote:
Originally Posted by JoKyR
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...
pSXAuthor is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 23:23.


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5