Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-core-dev] ICElement line number

> It was one example, other modules use the information.
> For example, some on the future/current work on the debugger:
> - BreakpointValidation, trying to set a breakpoint on non-statement 
> i.e #include
>   empty lines .. etc..

The CModel cannot help you with things that are beyond its scope 
(i.e. empty lines within a function body, which it has no bearing 
upon). 

> - Run/Jump to line, validation.  Run to line should only be enable for
>   line whitin the stackframe, outside it is undefine behaviour

If you have getStartLine() & getEndLine() for an IFunction (or similar)
object, you should be able to figure this out. 
 
> > There will be another mechanism to convert from offsets to line 
numbers 
> > for other modules to use. So It will be provided but only when needed 
and 
> > not with every call to parse.
> 
> Cool.
> 
> > Maybe JohnC could elaborate some more on the effect on performance.
> > 
> 
> Ok.
> 

Its purely a memory vs. runtime performance issue. 
If it turns out that most parser clients are require line number 
information then it can be integrated into the AST/tokens to benefit 
performance at the cost of memory. 

In any case, the infrastructure is available to implement a solution for 
1.2 if someone wishes. 

JohnC


Back to the top