Skip to content

Add new command 'dwarf types' to export DWARF info as json - #153

Open
Pwootage wants to merge 1 commit into
encounter:mainfrom
Pwootage:dwarf-json
Open

Pwootage wants to merge 1 commit into
encounter:mainfrom
Pwootage:dwarf-json

Conversation

@Pwootage

Copy link
Copy Markdown

This is handy for practice mod and primewatch - it allows me to extract the offsets directly without having to parse the output of the existing 'dwarf dump' command.

The general structure is roughly:

{
  "structs":   [...],
  "unions":    [...],
  "enums":     [...],
  "conflicts": [...]
} 

Each definition contains the size and name, and list of members/values.

Conflicts is a list of structs which the script with definitions that conflict across different compile units.

With Metroid Prime decomp's 0-00, it produces about 4.6mb of json:

 INFO 1496 structs, 10 unions, 384 enums, 40 conflicts

Exports DWARF info as json for easier use from other tooling which needs struct definitions and field offsets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant