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,290
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,
  • Like
Reactions: PandaPandel

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,290
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.
 
  • Like
Reactions: PandaPandel

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,290
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.
 
  • Like
Reactions: PandaPandel

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • S @ salazarcosplay:
    and co op
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, kind of like mugen or rivals of aether?
  • S @ salazarcosplay:
    and also ahve the option to play as a human
  • S @ salazarcosplay:
    or set it up that when you get injured past a certain point they have to replace your human parts with cybernetics
  • Xdqwerty @ Xdqwerty:
    i have a placeholder enemy sprite i made
  • S @ salazarcosplay:
    or have it that you don't know you are a cyborg, robot, and you find out and have a existential crisis
  • S @ salazarcosplay:
    or have it start in the virtual world and you are an ai that gained sentience
  • Xdqwerty @ Xdqwerty:
    btw gonna wash my face in a bit, my eyes feel tired
  • S @ salazarcosplay:
    and you convince your owner to help you break out of the virtual world to real world
  • BigOnYa @ BigOnYa:
    Eyes - "yawn"
    +1
  • S @ salazarcosplay:
    you bleack in to goverment computer systems to get cyborg schematics so you can get a robot body constructed
  • Xdqwerty @ Xdqwerty:
    btw @BigOnYa the health bar doesnt decrease when i take damage (and yes i put the "at the beggining of the scene change value of greenflatbar: set to Protagonistcopmode.Health::Health())
  • S @ salazarcosplay:
    i the protagonist
  • S @ salazarcosplay:
    human, robot, cyborg
  • S @ salazarcosplay:
    human with cyborg enhancements
  • S @ salazarcosplay:
    or like terminatior
  • S @ salazarcosplay:
    with living tissue
  • BigOnYa @ BigOnYa:
    @Xdqwerty there is health behaviour you can add to your character, then to use a health bar is lil more complicated, google n watch a few tutorial video on it, be too hard to explain here.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, the character has the health behavior
  • BigOnYa @ BigOnYa:
    I know you have to create a health and health max variable. Then there is a calculation you use in code to subtract width size of the health bar. Google few vids.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, the "greenflatbar" is one of the preset health bars btw
  • BigOnYa @ BigOnYa:
    Yea you can use any bar/sprite. It will just change the width. Ok good luck and have fun. I'm off to go shoot some pool at the bar. Talk to you later.
    +1
    BigOnYa @ BigOnYa: Yea you can use any bar/sprite. It will just change the width. Ok good luck and have fun. I'm... +1