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 

Bus Errors and how to pinpoint them

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



Joined: 26 Sep 2005
Posts: 672

PostPosted: Sat Mar 22, 2008 10:57 am    Post subject: Bus Errors and how to pinpoint them Reply with quote

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
View user's profile Send private message AIM Address
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Mar 22, 2008 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Mar 22, 2008 9:40 pm    Post subject: Reply with quote

Alternatively try running it in GDB and see if it produces something sensible. But the $epc-$mod stuff should work.
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Sat Mar 22, 2008 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Mar 23, 2008 4:30 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
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