sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
49 stars 0 forks source link

Extend SB Footer to include source map info #276

Open x87 opened 1 year ago

x87 commented 1 year ago

Make a simple mapping CODE_OFFSET:LINE_OF_CODE

0000 number of items
0004 line 1 offset
0008 line 2 offset
000C line 3 offset
...

adds +4 bytes per LoC to the footer size + 4 bytes for line count update Footer documentation

MiranDMC commented 1 year ago

Each source file should result in one mapping list (when include directive is used then there is multiple source files).

Currently Sanny source info only includes main source file. Perhaps current source code data structure should be multiplied with extra header field holding source filename (with path relative to main source file).

MiranDMC commented 1 year ago

Currently Include_Once builds unique list of files used to build final code. This list could be saved in footer like:

02 // number of items
"main.txt" 00 // first item
"utils\\vehicle.txt" 00 // second item

Then offset mapping table would look like:

0003 // number of entries (text lines in preprocessor output source file)
0004 00 0000 // binary offset 4 : file index 0, file line 0
0014 00 0007 // binary offset 20 : file index 0, file line 7
0028 01 0005 //  binary offset 40 : file index 1, file line 5