mheinsen / seec

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

Step over execution of inlined system header functions by default. #38

Closed mheinsen closed 11 years ago

mheinsen commented 11 years ago

Students shouldn't be exposed to the implementation of inlined standard library functions such as islower(), so step over any states within these functions.

mheinsen commented 11 years ago

This is going to be rough, because glibc defines macro versions of these functions which are used by default. One possibility is to use our own ctype.h header to declare these functions, have them mangled by the instrumentation pass, and then have our mangled implementations simply forward the call to the standard definition. Conveniently, no macro implementation is used on OS X (as far as the current testing has found), but at best this issue still depends on the standard library implementation that is being used.

Stepping over real inlined functions is handled in 7a4a4b227e7b331a8c61f8de340efd374012f66c.

mheinsen commented 11 years ago

f71c855d3dcc78b7e2451f2fd65af06b768253a8 avoids the macro/function duality issues with glibc by defining __NO_CTYPE=1 during compilation. This will do for the short term, so I'm closing this. If a more global solution is needed in the future we can investigate the possibility of hooking the preprocessor and automatically disabling/undefining macros that have the same name as standard library functions.