| View previous topic :: View next topic |
| Author |
Message |
hrimfaxi
Joined: 23 Nov 2006 Posts: 22
|
Posted: Wed May 27, 2009 12:43 am Post subject: mult/mflo strange result when using psp-gdb |
|
|
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 |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed May 27, 2009 2:59 am Post subject: |
|
|
| 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 |
|
 |
hrimfaxi
Joined: 23 Nov 2006 Posts: 22
|
Posted: Wed May 27, 2009 1:28 pm Post subject: |
|
|
| Thanks, I updated the latest psplinkusb and it works fine now. |
|
| Back to top |
|
 |
|