Homebrew Asking for tips on how to work with stack dumps (stack/core dumps) and disassembly source codes

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
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.

  1. Compile a project.
  2. Call on "make" to generate a BIN and ELF file.
  3. Throw the BIN file onto the microSD card.
  4. Toss the microSD card into the 3DS.
  5. Do something with 3DS.
  6. Make it crash, and have it show the stack dump, like so:
    6PIC3hY.jpg
  7. Take a picture of the stack dump.
  8. Save the dump onto the microSD card.
  9. Shutdown the 3DS.
  10. Pull out the microSD card from the 3DS.
  11. Drag off the DMP file from the "/luma/dumps/arm11/" folder to the PC.
  12. 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?
Thank you!
 
Last edited by delete12345,

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
What I am going to do is to see if I can use WinDbg to read the stack dump.

If this is not the right way to go about, then it has to be one of the executable binaries in the devkitPro/devkitARM/arm-none-eabi/ folder that I can use to understand the stack dump.

Let me know if this is correct, or wrong.
 

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,276
Country
United States
Apparently, I found out the stack dump file that was saved onto the microSD card, is none other than the same contents displayed on the screen. It's practically useless when you have already taken a picture of the dump that was shown on the 3DS. I guess it's probably the reason why this thread is being ignored by people, because they all knew it's just nothing.

------------

This is what I did to read out the contents of the saved stack dump, assuming you have nothing installed:

  1. Install Python 2.7.15.
  2. Install Git.
  3. Clone AuroraWright's Luma3DS master branch from Github.
  4. Start up Python 2.7 environment in your terminal of your choice (Windows, Mac, Linux).
  5. Navigate to Luma3DS git repo folder location.
  6. Navigate to "Luma3DS/exceptions/exception_dump_parser" folder.
  7. Run "py -2 setup.py install".
  8. Wait until Python finishes generating things.
  9. Navigate to [Your Python installation folder]/Scripts
  10. Run "luma3ds_exception_dump_parser-script.py" on the stack dump file on the microSD card.
  11. The output of the dump is then shown.

------------

Now, I need to figure out how to read those numbers.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: It's a shame some people's cake always resort to the same taste