| View previous topic :: View next topic |
| Author |
Message |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Sat Mar 22, 2008 10:57 am Post subject: Bus Errors and how to pinpoint them |
|
|
Hi guys,
Im trying to port over Mr.Peanut's Duke 3D to the slim however im having some trouble with some part.
I have got the SDLmain stuff out of the way and added
PSP_MODULE_INFO("Duke3d", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU);
PSP_HEAP_SIZE_KB(1024*20);
to the main c file.
After all the playing around I get a bus error as seen below
host0:/> Exception - Bus error (data)
Thread ID - 0x04838B5F
Th Name - user_main
Module ID - 0x04841253
Mod Name - Duke3d
EPC - 0x088E0D20
Cause - 0x1000001C
BadVAddr - 0x00010000
Status - 0x40088613
zr:0x00000000 at:0x08B20000 v0:0x00000000 v1:0x00000000
a0:0x08A0D6C8 a1:0x00000000 a2:0x88240407 a3:0x88013B00
t0:0x00000030 t1:0x00000030 t2:0x00000098 t3:0x88242298
t4:0x09FBFC48 t5:0x40088613 t6:0x089D6B68 t7:0x00088600
s0:0x00000012 s1:0x09FBFE34 s2:0x00000001 s3:0x09FBFEE0
s4:0x00000012 s5:0x00000013 s6:0xDEADBEEF s7:0xDEADBEEF
t8:0x000000A0 t9:0x88300000 k0:0x09FBFF00 k1:0x00000000
gp:0x08A161A0 sp:0x09FBFC80 fp:0x09FBFC80 ra:0x088E0D0C
0x088E0D20: 0xA0400000 '..@.' - sb $zr, 0($v0)
How do i tell where the bug is?
Wally |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Mar 22, 2008 11:30 am Post subject: |
|
|
I read this somewhere
In psplink shell:
calc $epc-$mod (also try reverse)
Then do:
psp-addr2line -f -e file.elf "the resulting val" _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sat Mar 22, 2008 9:40 pm Post subject: |
|
|
| Alternatively try running it in GDB and see if it produces something sensible. But the $epc-$mod stuff should work. |
|
| Back to top |
|
 |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Sat Mar 22, 2008 10:02 pm Post subject: |
|
|
| TyRaNiD wrote: | | Alternatively try running it in GDB and see if it produces something sensible. But the $epc-$mod stuff should work. |
Yeah I tried, thanks to IWN who helped me big time live in chat. Haven't seen you there for a while TyRaNiD :/
The error was some malloc related error to do with save which was buggy as hell anyway. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Mar 23, 2008 4:30 am Post subject: |
|
|
| There's always the "tried-and-true" methods of debugging: logging, and waiting. Logging means you print after various points, either to a file or the screen. Waiting is something I like to do - just make a function to waits for you to press a button (which one is passed in to the function) before it returns. Then I just stick different button waits at different points. You can find the area the fault occurs pretty quick that way. |
|
| Back to top |
|
 |
|