forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mult/mflo strange result when using psp-gdb

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
hrimfaxi



Joined: 23 Nov 2006
Posts: 22

PostPosted: Wed May 27, 2009 12:43 am    Post subject: mult/mflo strange result when using psp-gdb Reply with quote

Hi, folks. When I use psp-gdb to debug my application, something weird happened:

Code:
int a = 1024;
int b = 768;
int c = a * b;


If I use gdb next instruction on "int c = a * b", it will get a very strage result: c = 64 ...

The disassemble version of the code is :
Code:

li $v0, 0x400
li $v1, 0x300
mult $v0, $v1
mflo $v0


If I use gdb si instruction on these instruction, I will also get the same result.

If I don't use gdb, run this code directly, I will get the corrent result 786432.

I am using psp-gcc 4.3.2 and psp-gdb 6.8 from the latest psptoolchain SVN trunk.

TODO: I will get some more deatils on this bug.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed May 27, 2009 2:59 am    Post subject: Reply with quote

Ahum, looks like the is a bug in psplink's exception handler :) It never restores the lo/hi registers so stepping over the instructions trashes the values and you get crap back. Try checking out the latest psplinkusb and updating your psplink.prx file.
Back to top
View user's profile Send private message
hrimfaxi



Joined: 23 Nov 2006
Posts: 22

PostPosted: Wed May 27, 2009 1:28 pm    Post subject: Reply with quote

Thanks, I updated the latest psplinkusb and it works fine now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group