1. Poketard

    OP Poketard GBAtemp Regular
    Member

    Joined:
    Apr 3, 2013
    Messages:
    163
    Country:
    United States
    I got tired of trying to use No$GBA's debug tools that just seemed to hate my PC, so I made my own modified version of DeSmuME with all the tools I wanted.

    Features: code breakpoints, memory breakpoints, stepping through code

    How to use:

    There is new breakpoint options in the disassembler and memory viewer. Type an address in the box and press "add breakpoint" to add a new breakpoint of the respective type; select "Delete Breakpoint" to delete a breakpoint of the respective type from the top of the list. Use the arrow buttons to scroll the list.

    Note: memory break points don't update the disassembly window, you'll have to refresh yourself. If you want to find the current code position, just copy what's in PC and scroll up 2 (no, I don't know why PC shows 2 operations ahead, that's just how it is in DeSmuME)

    The rest should be self explanatory enough to anyone familiar with debugging.

    Download: https://github.com/Yackerw/desmume/releases/tag/DebugRelease_0_1
     
    Last edited by Poketard, Aug 16, 2020
    BillyTime and banjo2 like this.
  2. Coto

    Coto -
    Member

    Joined:
    Jun 4, 2010
    Messages:
    2,768
    Country:
    Chile
    ARM Processors have the prefetch unit (+8 Bytes, 2 ARM opcodes, 4 THUMB v1 opcodes) and the relative PC offset always starts +4 bytes from it. That makes 12bytes of prefetch which is how surrounding opcodes / data stand from the Program Counter. (r15)
     
  3. Poketard

    OP Poketard GBAtemp Regular
    Member

    Joined:
    Apr 3, 2013
    Messages:
    163
    Country:
    United States
    Ah, I didn't know that. I'm relatively new to DS hacking, but I just found the entry point to be really rough with currently existing tools, so I opted to try and fix that myself. So I don't actually know that much about ARM yet.
     
  4. Coto

    Coto -
    Member

    Joined:
    Jun 4, 2010
    Messages:
    2,768
    Country:
    Chile
    Doesn't matter! I've wasted a good few years with ARM Cores, if you have any questions, ask away.

    You should read about the PSR bits:

    http://www.cs.otago.ac.nz/cosc440/readings/arm-syscall.pdf

    page 2. ARM Cores (and programs built with it, NDS games, etc), have different ARM processor modes. Such as software interrupt ( a software request using hardware resources), where the (swi)stack pointer, LR,PC and specific registers will be swapped in, saving current processor mode in CPSR register. Once the request is done it'll go back to last PSR mode (saved in SPSR register), then restoring such processor mode registers, as said in (PDF) page 2.
     
    Last edited by Coto, Aug 16, 2020
  5. FAST6191

    FAST6191 Techromancer
    Reporter

    Joined:
    Nov 21, 2005
    Messages:
    33,485
    Country:
    United Kingdom
    More debug options is nice, especially something between cheats and simple viewers and long chain regex style breakpoint options (nice to have but sometimes I just want to have a simple one). no$gba usually did OK for me though. Either way will have to have a look at this later.
     
  6. Poketard

    OP Poketard GBAtemp Regular
    Member

    Joined:
    Apr 3, 2013
    Messages:
    163
    Country:
    United States
    Huh. I wonder if the no$gba problems were just something to do with my PC or something, then; but I for the life of me couldn't get break points working properly. Drove me to insanity...
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - debugger, DeSmuME, version