The following steps are what I know, thus far, on working with stack dumps. It's definitely going to be wrong because all of this is just self-taught knowledge.
And then from this point, I have no idea what to do. I have some questions:
- Compile a project.
- Call on "make" to generate a BIN and ELF file.
- Throw the BIN file onto the microSD card.
- Toss the microSD card into the 3DS.
- Do something with 3DS.
- Make it crash, and have it show the stack dump, like so:
- Take a picture of the stack dump.
- Save the dump onto the microSD card.
- Shutdown the 3DS.
- Pull out the microSD card from the 3DS.
- Drag off the DMP file from the "/luma/dumps/arm11/" folder to the PC.
- Use devkitPro's "arm-none-eabi-objdump --source [ELF file]" to read the disassembled source file from the ELF file generated when on Step 2.
And then from this point, I have no idea what to do. I have some questions:
- I understand that the values on the 3DS bottom screen in the stack dump display is the memory values. Why is it showing only that portion of the memory? Is it because when the crash happened, it takes a snapshot of the memory from where the crash occurred + offset at 0, to the crash address + offset 0x90?
- I also understand the disassembly source code has addresses that are very different from the addresses on the hardware and in the DMP file. It would seem that I need to add some "offset value" to the addresses for the disassembly source code, so that the addresses there can match the addresses on the 3DS hardware, as well as the DMP files generated. Where do one get that "offset value"? And how should I add the offset value to the disassembly source file?
- What other steps do I need to do to make life easier when it comes to debugging stack dump errors and uncaught segfaults, both on the hardware side (3DS) and when reading the disassembly source code?
Last edited by delete12345,