[cfe-dev] 'recording' program execution w/clang

Edward Peschko horos11 at gmail.com
Tue Nov 4 09:38:36 PST 2008


Chris,

I want to be able to record two versions of the same program and then
do a diff to see in the code where the execution path changes..

For example, say you want to see in mutt what the 'd' key does in the
gui, ie: what parts of the source does it execute.. To do so, record
two sessions, one where you press the d key, and one where you don't.
Do a 'vimdiff' between the two, and you have your answer - without
needing to know the structure of the code at all.

Hence, I'd need actual code, because ultimately I want to use this
with an IDE to trace it back to the original source (and set further
debug points, etc.)

Ed



On 11/4/08, Chris Lattner <clattner at apple.com> wrote:
>
> On Nov 3, 2008, at 3:51 PM, Edward Peschko wrote:
>
>> All,
>>
>> I had a question with regards to clang - ie whether or not it was
>> suited for the following.
>>
>> Right now, I have a very, very hackish set of perl modules which
>> instrument my c and c++ code with tracing code, per step via macros.
>> ie: I start out with -
>
> Hi Edward,
>
> Is there a specific reason that you want to do this at the source
> level?  This sort of thing may be easier to do at the LLVM IR level.
> There are several examples of this sort of thing in the lib/transforms/
> instrumentation directory in LLVM,
>
> If you really have to do this at the source level, I believe Clang can
> support it, but doing it at the LLVM IR level would give support for C+
> + today as well as a number of other languages supported by llvm-gcc.
>
> -Chris
>



More information about the cfe-dev mailing list