1. Mapping machine addresses to source file and line numbers.
- Posted by petelomax Apr 18, 2023
- 545 views
Going back to basics, from a carte blanche design perspective, how might you best achive this?
Obviously the compiler reads the source so knows some line numbers, and generates the corresponding binary,
so at some point, somehow, somewhere, it should be able to save whatever you need in some suitable structure.
Performance at the point of use is not an issue, but (packed) size and initial build speed probably are.
Choose anything from flat tables, binary and other trees, dictionaries, or whatever else might be useful.
PS The current mechanism is per-routine (including implicit file subroutines) packed delta offset tables(!).
2. Re: Mapping machine addresses to source file and line numbers.
- Posted by ghaberek (admin) Apr 18, 2023
- 528 views
I would use DWARF debugging standard. It's stable and mature and provides a lot of flexibility for custom information if you need it (see section 7.1 Vendor Extensibility).
-Greg
3. Re: Mapping machine addresses to source file and line numbers.
- Posted by katsmeow Apr 18, 2023
- 502 views
Smells like, with compilation (or conversion to IL code) delayed until it's needed, someone could sneak in alternative source code lines for execution. This could be a whole new level of program flow control.
Last method of control i saw as epic was a jump table, where the choice of wherein to jump was set by a set of three(?) registered parallel lines from outside the cpu as the lowest bits of the JMP target byte.
Kat