[cfe-dev] Debug Info Generation in Clang.

Chris Lattner clattner at apple.com
Thu May 1 09:45:06 PDT 2008


On May 1, 2008, at 4:31 AM, Sanjiv.Gupta at microchip.com wrote:
>> On Apr 29, 2008, at 3:54 AM, Sanjiv.Gupta at microchip.com wrote:
>>> I was thinking that putting it in CodeGenFunction::EmitStmt
>> may result
>>> in redundant stoppoint being emitted. But that is taken care of by
>>> EmitStopPoint function itself, which checks to see if we
>> have changed
>>> from the previous line number. So EmitStmt looks the correct place.
>>
>> Yep, that makes sense to me too.
>>
>
> Well, putting it into EmitStmt still results into unnecessay  
> stoppoints
> being generated.
>
> For a piece of code like
> 1: foo ()
> 2: {
> 3:   int I = 5;
> 4: }
>
> Two stoppoints will be generated for line 2 and line 3;
>
> We do not want to generate a stoppoint for a '{' (CompoundStmt).

I think it is probably best to put it into EmitStmt and filter out  
stmts that you don't want stoppoints for.  EmitStopPoint itself should  
avoid emitting multiple stoppoints on the same line.  For example, in  
"x = 4; y = 1; z = 12;" we only want one stoppoint.

> I am thinking to go back to my earlier thoughts and put it into below
> functions:
> EmitScalarExpr
> EmitComplexExpr
> EmitAggExpr

The problem with this is that it means that you'll get tons of  
duplicated stoppoints for every subexpression "2*a + 1" would have 5  
stoppoints, most of which would get filtered out.  Are you sure about  
this?

-Chris



More information about the cfe-dev mailing list