SNASM68K COFF dump tool
Posted: Mon Jan 25, 2016 3:02 pm
Hi!
I'm writing some tools to help make my development life with SNASM68K easier, starting with a tool to extract file/line info from a physical address to use in conjunction with an exception handler in my game.
Here it is: sn68kcoffdump.exe!
It can show a summary of COFF contents, dump all symbols, extract the ROM as a standalone file, and fetch a symbol/file/line from a code address.
My aim is to work up to creating a source level debugger plugin for Exodus.
Source: https://github.com/BigEvilCorporation/SN68KCOFFDUMP
Binary: https://www.mediafire.com/?mwof7vbowbt8qr1
Usage:
Example of -addr2line:
Example of -symbols:
SNASM COFF files are almost standard COFFs, with a few exceptions:
- Machine type is fixed at 0x150 (covers all 68000 family, no sub-type provided)
- There are 3 fixed sections: Filename Table Section (1-based string list), Debugger Section (format currently unknown), and ROM Section (contains ROM data, line number table, symbol table)
- Line number entries hold indices to the filename table, and not the symbol table like other COFF types
- There's no mapping from line number section headers to symbols, instead symbols must be sorted and the nearest entry searched for by address
I hope someone finds it useful!
I'm writing some tools to help make my development life with SNASM68K easier, starting with a tool to extract file/line info from a physical address to use in conjunction with an exception handler in my game.
Here it is: sn68kcoffdump.exe!
It can show a summary of COFF contents, dump all symbols, extract the ROM as a standalone file, and fetch a symbol/file/line from a code address.
My aim is to work up to creating a source level debugger plugin for Exodus.
Source: https://github.com/BigEvilCorporation/SN68KCOFFDUMP
Binary: https://www.mediafire.com/?mwof7vbowbt8qr1
Usage:
Code: Select all
Usage:
sn68kcoffdump filename.cof [options]
Options:
-summary Prints COFF summary
-symbols Prints symbol table
-extractrom [filename] Extracts ROM file
-addr2line [hex address] Prints file/line and symbol from physical address
Code: Select all
C:\bigevilcorporation\bigevilframework\TANGLEWD\BIN>sn68kcoffdump.exe TANGLEWD.COF -addr2line 45e
-------------------------------------
SNASM2 68000 COFF File Info Dump Tool
-------------------------------------
Release 0.1a, 23/Jan/2016
Matt Phillips, Big Evil Corporation
http://www.bigevilcorporation.co.uk
-------------------------------------
Address 0x45e
Filename: C:\TANGLEWD/..\framewk\interpts.asm
Line: 38
Nearest symbol name: Exception
Nearest symbol address: 45a
Code: Select all
C:\bigevilcorporation\bigevilframework\TANGLEWD\BIN>sn68kcoffdump.exe TANGLEWD.COF -symbols
-------------------------------------
SNASM2 68000 COFF File Info Dump Tool
-------------------------------------
Release 0.1a, 23/Jan/2016
Matt Phillips, Big Evil Corporation
http://www.bigevilcorporation.co.uk
-------------------------------------
-------------------------------------
SYMBOLS
-------------------------------------
0x0 __start
0x200 EntryPoint
0x26a Main
0x270 VDPDMAQueue_AddJob
0x298 VDPDMAQueue_ExecuteAll
0x2d2 GetTerrainTile
0x310 GetCollisionTileFlags
0x348 GetTerrainHeight
0x3ac InitGamepads
0x3be InitEXTPort
0x3c8 ReadPadA
0x3f8 ReadPadB
0x428 VBlankInterrupt
0x44e HBlankInterrupt
0x45a Exception
0x460 NullInterrupt
0x462 Clamp
0x47c RandInit
0x488 RandLong
0x4b8 VectorAdd
0x4c4 VectorSub
0x4d0 VectorDistSq
0x4e8 VectorDot
0x4f6 CompareString
0x514 strcmp_diff
0x51a strcmp_end
0x51c GetMCDType
0x590 MCD_RestoreHINT
0x5aa InitMCD_Mode1
0x61e SubCPU_int
0x626 SubCPU_rte
0x628 ClearRAM
0x64a InitPSG
0x65e LoadTiles
0x6b4 LoadTilesDMA
...
0x28101 bgm_titles
0x284c8 tiles_bigevil_logo
0x29688 tiles_tanglewood_logo
0x2c988 tiles_lvl1
0x366c8 collisiontiles_lvl1
0x37328 map_bigevil_logo
0x37c88 map_tanglewood_logo
0x385e8 map_lvl1
0x5feb8 collisionmap_lvl1
0x87788 Z80Program
0x88988 __end
- Machine type is fixed at 0x150 (covers all 68000 family, no sub-type provided)
- There are 3 fixed sections: Filename Table Section (1-based string list), Debugger Section (format currently unknown), and ROM Section (contains ROM data, line number table, symbol table)
- Line number entries hold indices to the filename table, and not the symbol table like other COFF types
- There's no mapping from line number section headers to symbols, instead symbols must be sorted and the nearest entry searched for by address
I hope someone finds it useful!