Giter VIP home page Giter VIP logo

ido's Introduction

IDO uopt debugger

Screenshot

An interactive ncurses debugger for the global optimization pass of the IDO C compiler.

Compilation

Requires 32-bit ncurses to compile and run.

Due to hardware differences, alignment issues, and probably subtle bugs in the decompilation, only the 32-bit version of uopt on x86 behaves correctly.

Install 32-bit ncurses and gcc, then type make.

Ubuntu

To install 32-bit packages on Ubuntu run the following: sudo dpkg --add-architecture i386 && sudo apt update

These are some of the requirements (not comprehensive): sudo apt install libncurses6:i386 libtinfo-dev:i386

Running the Debugger

Run ./udb.py path/to/source/file.c [make flags]

This compiles the given file, but runs the debugger instead of uopt.

The script assumes that your decomp project uses make as a build system, and that it uses n64decomp/ido-static-recomp instead of qemu-irix.

Controls

The main keys to know are c (color) and x/X (examine).

Key Action
hjkl Move the cursor
^$ Move cursor to start/end of line
gG Jump to top / bottom of tile
du Jump half a page down / up
C-F Jump one page down
C-B Jump one page up
s Split window horizontally, creating a new window below the current one
S Split window vertically, creating a new window to the right of the current one
Esc Open the tile menu in the current window
Enter While in the tile menu, open the tile under the cursor
HJKL Move cursor to a different window
q Close the current window (unless there is only one window)
Q Stop debugging the current function, advance to the next one in the file
c Globally highlight whatever object is under the cursor
C-L Redraw the current window
C-L C-L Redraw all windows
xX Examine whatever object the cursor is on. Opens a new window that displays the struct's fields and their values
v Highlight each distinct object on the current line in a different color, up to a depth. The depth highlighted increases with each press
V Like v, but decreases the depth

See also the functions named *_tile_input in ncdebug.c for other controls specific to certain windows. These keys will probably be removed, so they aren't worth including in the table above.

IDO decompilation project

This project aims to decompile IDO 7.1, and maybe 5.3 too.

The src directory for uopt was created using the following command:

mkdir src
cd src
../mipsdisasm/elfdump -i -p ~/ido7.1_compiler/usr/lib/uopt -t ../uopt_split_specification.txt

To generate an assembly file that can easily be used with mips_to_c, run the following command:

mipsdisasm/elfdump -i -r -p ~/ido7.1_compiler/usr/lib/uopt > uopt71.s

The resulting C files can be compiled with mips-linux-gnu-gcc with the args -c -fPIC.

ido's People

Contributors

synray avatar emill avatar louist103 avatar queueram avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.