Skip to content

[DWARF] Use MIPS register names for DWARF dumped from MIPS binaries #88

@1superchip

Description

@1superchip

DTK was designed around PPC but it also supports LE DWARF info which allows it to be used for PS2 binaries that contain DWARF v1. When dumping DWARF info from MIPS binaries, the register names used are PPC names. Using the MIPS names for registers would help when decompiling rather than seeing the PPC names.

Related source:

pub const REGISTER_NAMES: [&str; 109] = [

MIPS register names: https://en.wikibooks.org/wiki/MIPS_Assembly/Register_File

In the following code, r29 is actually sp for MIPS.

/*
    Compile unit: C:\work\sf33rd\AcrSDK\ps2\flps2vram.c
    Producer: MW MIPS C Compiler
    Language: C
    Code range: 0x003FC830 -> 0x003FC968
*/
// Range: 0x3FC830 -> 0x3FC968
static void PageConv4to32(unsigned char * p_input /* r29+0xB0 */, unsigned char * p_output /* r29+0xC0 */, signed int p_page_w /* r29+0xD0 */) {
    // Blocks
    /* anonymous block */ {
        // Range: 0x3FC830 -> 0x3FC968
        signed int i; // r17
        signed int j; // r16
        signed int nb; // r18
        signed int * tbl; // r19
        unsigned char * pi; // r29+0xAC
        unsigned char * po; // r30
        signed int n_width; // r23
        signed int n_height; // r22
        signed int i_size; // r21
        signed int o_size; // r20
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions