Well, sometimes in my program when I hit Home to return to the Homewbrew Channel, a exception take place.
My knowledge in Wii Programming is not very extensive, all I can read from there is that a DSI exception ocurred, and i have the stack copy, wich I think it could help me debbugging.
¿What's a DSI exception?¿How could I translate de Stack Dump into lines of my code?
Thanks in advance
Trying to understand the exception
Re: Trying to understand the exception
An illegal memory access, most likely an invalid or NULL pointer.lupidan wrote:¿What's a DSI exception?
¿How could I translate de Stack Dump into lines of my code?
Code: Select all
Usage: ./powerpc-gekko-addr2line [option(s)] [addr(s)]
Convert addresses into line number/file name pairs.
If no addresses are specified on the command line, they will be read from stdin
The options are:
@<file> Read options from <file>
-b --target=<bfdname> Set the binary file format
-e --exe=<executable> Set the input file name (default is a.out)
-i --inlines Unwind inlined functions
-j --section=<name> Read section-relative offsets instead of addresses
-s --basenames Strip directory names
-f --functions Show function names
-C --demangle[=style] Demangle function names
-h --help Display this information
-v --version Display the program's version
./powerpc-gekko-addr2line: supported targets: elf32-powerpc aixcoff-rs6000 elf32-powerpcle ppcboot elf32-little elf32-big srec symbolsrec tekhex binary ihex
Report bugs to <http://www.sourceware.org/bugzilla/>
Re: Trying to understand the exception
Thanks a lot Samson
Well, i went to my Makefile to check if the -g option is enabled
And wehenever I try to use the debugger...
All I get is this:
I guess the debugging information is not present. ¿Should I change something in my code?
UPDATE:
I tried removing the -O2 flag from de CFLAGS, and now it doesn't seem to crash, when It was present, the program randomly crashed when I clicked the home button to return to Homebrew Channel. ¿Possible bug?
Well, i went to my Makefile to check if the -g option is enabled
Code: Select all
CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE)
Code: Select all
powerpc-gekko-addr2line -e Game.elf
0x813a373c
Code: Select all
??:0
UPDATE:
I tried removing the -O2 flag from de CFLAGS, and now it doesn't seem to crash, when It was present, the program randomly crashed when I clicked the home button to return to Homebrew Channel. ¿Possible bug?
Re: Trying to understand the exception
Do you have -g in the linker flags, when you create the elf, as well?
BTW: For a test find the address of main(), and see if you can resolve it from the address. And there is a chance that the crash is outside your program.
Have a look at the map file, or the section information printed by readelf, which memory addresses your program actually covers.
BTW: For a test find the address of main(), and see if you can resolve it from the address. And there is a chance that the crash is outside your program.
Have a look at the map file, or the section information printed by readelf, which memory addresses your program actually covers.
Re: Trying to understand the exception
Thanks for answering
Well, my load flags also have -g:
And, in the end, the program crashed, I tried to locate the code dump:
8133883C:
8133884C:
8133885C:
And in the .elf.map file there isn't a single reference to a line 0x813....
I also tried again powerpc-gekko-addr2line -e Game.elf 0x8133883C but nothing... what am I missing?
Well, my load flags also have -g:
Code: Select all
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
8133883C:
8133884C:
8133885C:
And in the .elf.map file there isn't a single reference to a line 0x813....
I also tried again powerpc-gekko-addr2line -e Game.elf 0x8133883C but nothing... what am I missing?
Re: Trying to understand the exception
You've most likely corrupted/wrote to High MEM1 memory where the loader code is stored.
When your application exits, an attempt is made to re-load the loader (typically HBC) from that memory location.
I'm not sure if LibOGC currently protects against this in sbrk, so that LibOGC itself does not allocate memory out of the loader section when you call malloc.
When your application exits, an attempt is made to re-load the loader (typically HBC) from that memory location.
I'm not sure if LibOGC currently protects against this in sbrk, so that LibOGC itself does not allocate memory out of the loader section when you call malloc.
Who is online
Users browsing this forum: No registered users and 0 guests