mheinsen / seec

Program visualization and debugging for novice C programmers
http://seec-team.github.io/seec/
MIT License
3 stars 0 forks source link

Support compilation, instrumentation, and linking from within seec-trace-view. #26

Closed mheinsen closed 7 years ago

mheinsen commented 11 years ago

For the use trials, seec-trace-view should be a complete interface to using the SeeC system. Users should be able to compile (with instrumentation) their source code directly to an executable file (from the user's perspective) from within seec-trace-view. Don't rely on the clang binary to perform linking for us, as there may be a version mismatch between the installed binary and our Clang libraries.

mheinsen commented 11 years ago

The first step of this should be to turn seec-cc (seec-clang-test) into a transparent replacement for gcc/clang that performs instrumentation at the appropriate stage. Hopefully we can leverage the Clang driver to do this.

Update: at the moment it seems unlikely that we'll be able to custom Clang's driver for this. A nice solution would have been to insert "-emit-llvm" and "-O0" into the command line arguments, run them through the driver, replaced "clang" with "seec-cc", and finally used a LTO pass to add the SeeC instrumentation. Unfortunately it seems that LTO uses a fixed libLTO at the moment (i.e. /usr/lib/libLTO.dylib on OS X), and we don't want to replace the system's libLTO with SeeC's. If it becomes simple to use custom passes with libLTO, then we should investigate this further. For now, we'll have to create a simpler tool.

mheinsen commented 11 years ago

Perhaps we can make a simple command line tool that takes a list of object files, links all the LLVM modules together, instruments them, then passes this new object file along with any previously specified native object files to the standard linker to generate the final executable. This might server as a suitable alternative to the above.

mheinsen commented 11 years ago

We now have the tool described above, named seec-ld. The next step is to make seec-cc a little bit smarter. Essentially it should use the Clang Driver to generate a compilation, but make compile actions use seec-cc and linking actions use seec-ld. This isn't going to magically work for all situations, but it should handle the compile process used by students.

mheinsen commented 11 years ago

08b6504d5c3960ac7ab6b857f144c905e2d16ec0 implements the next major piece of this, but we still need to wire up the serialization of the SeeC-Clang mapping metadata.

mheinsen commented 11 years ago

All the major changes to seec-cc are done now. If we want to add compilation to seec-trace-view, it should be trivial to call out to seec-cc with the appropriate arguments.

mheinsen commented 11 years ago

Dropping this from 13.08 as using seec-cc should be sufficient for the trial run.

mheinsen commented 7 years ago

This issue was moved to seec-team/seec#13