2 ms·
Yet more bonus points if you implement a way to correlate (roughly) the assembly code with the corresponding C++ code. Like, when you select lines in the C++ co
by franzb 14y ago
Yet more bonus points if you implement a way to correlate (roughly) the assembly code with the corresponding C++ code. Like, when you select lines in the C++ code, it highlights the corresponding assembly instructions. Not trivial, especially at high optimization levels.
- ethereal 14y agoActually, it's not that difficult. Get GCC to generate DWARF [debugging] information, and then use that to provide the back-references. (Reference: DWARF 3.0 spec, available at http://dwarfstd.org/doc/Dwarf3.pdf http://dwarfstd.org/doc/Dwarf3.pdf. See page 92.) This is how GDB does the same. The output is a little weird (I've had it execute line 56 before line 55, for example) and you do have to be careful, as not all lines translate directly. But it would be at least be a nice starting point. There are even some nice libraries out there that parse this information! EDIT: Hmm, I just noticed that the source is on Github. If I get some time this weekend I'll try adding support for this.