Debugger: should expressionUnderCursor use the DUCain?

Vladimir Prus ghost at
Sun Mar 21 12:52:10 UTC 2010

Niko Sams wrote:
> Hi,
> The current implementation of
> VariableController::expressionUnderCursor (should return
> the string of the variable that should be shown in the variable
> tooltip) parses the text
> manually.

Yes. Back then, David told me that's the right way.

> Thow issues with this implementation:
> - it's buggy ( - but that
> can be fixed

I believe I saw some other bugs along the same lines.

> - it shows the popup for basically everyting (functions, macros, even
> comments) while it should
>   only for variables (we could simply ignore this)
> And we have the data in the DUChain - why not use it; a simple
> findContextAt and findDeclarationAt
> should do it.
> Issues:
> - it only works when the file is parsed correctly (projects may not be
> setup correctly etc)
> - gdb supports much more than just c/c++ (but atm we don't)

I am a bit nervous about expecting full-blown parsing to be available
for tooltips to work. You can very well step into code that is not
built by KDevelop at all, and you won't have include paths for that,
or the parsing might not be yet complete.

- Volodya

More information about the KDevelop-devel mailing list