noteMenuArea is defined as an integer, and im pretty sure its that line but changing the numbers in the if structure or the numbers in the first line of code seem to fix the problem and the program wont crash, but then it doesnt do what i want, if i have the first line correct and set the if structure to this
with the code in the second two options commented out
but if i uncomment any of it the program crashes again
p.s: is there a way to recover from a crash in psplink without having to restart the psp??
EDIT: okay i think i have the same problem as i had before http://forums.ps2dev.org/viewtopic.php?t=7522 uncommenting say 3 of those variable assignments in the 4th option works, but uncommenting anymore and the program crashes and if i uncomment deleteNotes() with the rest still commented it crashes it seems that too much code crashes my psp, and last time i dint fix anything it jsut worked again by itself after compiling one day[/url]
You need to provide more of the code... say the entire function that switch is in, and where any global variables used are defined. Simply saying "x++; fails on my program" is impossible to debug by itself.
using global variables was one of the easiest ways i could think of having the variables because i needed access to most of them in alot of diffferent functions and didnt want to have to pass stuff through to the functions all,
but with your struct suggestion, your talking about my global variables right like grouping like variables together in structs??
May be it crashing in deleteNotes()?
Or may be your application multithread and bad values caus bad behavior.
For me it's hard to immagine how changing values of variables can crash programm right in moment when thay changed.
yeah i found it hard to believe as well but i know deleteNotes() works cause its not the only time in the program it is used, the only thing that i can see that crashes it is adding more code to do with variable assignment adding usless code like
allows the program to still work but if option 3 and 4 are filled with the code i need in there it will crash, i believe it is to do with memory alignment but no one seems to be able to really explain what that is or how to fix it,
am i just declaring and initializing my variables in the wrong way should they be in a particular order??
compile with -g, then use psp-addr2line with the EPC adress to find out where it actually crashes.
Have you done this? It might be time to crack out the dissasembler and see exactly which instruction it is faulting on, and what it is attempting to do...
am i just declaring and initializing my variables in the wrong way should they be in a particular order??
Hard to say - if thry're global variables and you've only supplied function snippets. With badva being 0, it could be a null dereference somewhere, but then again it's being reported as a fpu exception...
http://lukasz.dk/programming/playstatio ... debugging/ is a link for doing it on ps2 with ps2-link. And the procedure would be almost exactly the same.
Simply add -g to the CCFLAGS (or similar) variable in the makefile, and use psp-addr2line on you elf as explained in the document above.
Unfortunately I am at work right now and cannot dig up more exact instructions without wasting too much time.
I had such radom crashen when I used some static defined variables (It was really weird to find that bug).
my solution was to declare them as external and define them in a c-file.
reefbarman wrote:using global variables was one of the easiest ways i could think of having the variables because i needed access to most of them in alot of diffferent functions and didnt want to have to pass stuff through to the functions all,
but with your struct suggestion, your talking about my global variables right like grouping like variables together in structs??
Yes.
Also, please stop bumping threads 1 hour after you last post, that's useless and annoying.
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
Probably more likely it is crashing in the osl code and that happens not to be built with debugging symbols. I dont recall if osl came with source, if it does you should be able to rebuild with the appropriate -g switch and then rebuild your app.
Tinnus wrote:
Also, please stop bumping threads 1 hour after you last post, that's useless and annoying.
haha if you look carefully its actually about 12 hours in between posts cause 12pm doesnt just turn into 1 am anyways
you should try both kernel- and usermode adress, eg when EPC=0xxxxxxx then try 0xxxxxxx and 8xxxxxxx aswell
i have tried that and still no luck
Probably more likely it is crashing in the osl code and that happens not to be built with debugging symbols. I dont recall if osl came with source, if it does you should be able to rebuild with the appropriate -g switch and then rebuild your app.
yeah it does come with the source so i will have to give it a go and see what i can do thanks tyranid
okay it seems oslib is all just header files and the like and they are all just installed into the pspsdk directory so they just get included in my compiling so i guessing the -g flag will be used for those files when compiling my app yes???
Well no, if you dont have the full source to rebuild the libraries with debugging symbols enabled then you wont gain much. Any headers you include will automatically populate the debug symbol table when pulled into code files which are compiled with -g. You'll have to see if the source for osl is actually available.
thanks everyone for you help i eventually solved my problem by breaking my code up into mulitple source files and it seemed to work so im on my way to developing again thanks so much