This crash is ocurring at random times... how can i trace the line code?
I have symbol file, but not sure wich values should i look for (there is nothing related to ADDR in that file)
thanks!
Help with crash
Moderator: Stef
Help with crash
- Attachments
-
- Screenshot from 2019-10-05 20-55-36.png (17.85 KiB) Viewed 6412 times
Re: Help with crash
You can try addr2line with the generated .elf file and that PC address. Verify with a debugging emulator, use the memory view and see what asm is at the pc address.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Help with crash
A0 clearly got loaded with the wrong value. Why is the question, and could have many answers. You'll need to find the code where a0 is getting loaded and find where it got off.
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: Help with crash
Be carefull with array sizes, maximum variable sizes, variable initialization.
Use GensKMod with debug options, CPU -> Messages.
Use GensKMod with debug options, CPU -> Messages.
Re: Help with crash
thanks to all, i am developing in linux though and dont have access to gens kmod, only gens, but that one doesnt have debug opions afaik. Using addr2line I only got garbage values like ??:??, maybe some transformation to the address is necessary? that looks like a really strange address..
I redid the linked list code and i think i got ride of the bug at least !
I redid the linked list code and i think i got ride of the bug at least !
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Help with crash
You want to use PC for addr2line, not the faulting ADDR. The faulting address is clearly trash loaded from somewhere unintended - an unset pointer, an out of range array, whatever. You want to look at the code at the PC to see what it was doing when it loaded A0 so you can find it in your code to determine where you went wrong.
And I dev in linux for old consoles, too. What I do is make logging routines - they sometimes print messages to the screen, and in some cases merely set the background color. By setting different colors at different points in the code, you can tell how far it got before crashing at a glance. You can also run gens kmod in WINE.
And I dev in linux for old consoles, too. What I do is make logging routines - they sometimes print messages to the screen, and in some cases merely set the background color. By setting different colors at different points in the code, you can tell how far it got before crashing at a glance. You can also run gens kmod in WINE.