QUrl of Breakpoints

Milian Wolff mail at milianw.de
Sat Sep 13 19:45:27 UTC 2014


Hey all,

I've hit an issue in the QUrl port. Looking at the GDB plugin code, it seems 
to me as it currently works a lot with relative URLs. It stores the local of 
the breakpoint as a QUrl, but GDB allows the user to specify the breakpoint in 
free-form, e.g. "foo.cpp:123" gets currently split up and turned into a 
relative URL holding "foo.cpp". While this is OK, it breaks as soon as we try 
to find that file, i.e. in breakpointmodel.cpp in KDevPlatform we have code 
like this:

    IDocument *doc = ICore::self()->documentController()-
>documentForUrl(breakpoint->url());

Potentially there are even more places like that. I'll now ensure that the URL 
always holds the absolute URL. But I think this breaks the GUI expectation, 
see e.g. BreakpointController in KDevelop/debuggers/gdb:

            /* If the address is not empty, it means that the breakpoint
               is set by KDevelop, not by the user, and that we want to
               show the original expression, not the address, in the table.
               TODO: this also means that if used added a watchpoint in gdb
               like "watch foo", then we'll show it in the breakpoint table
               just fine, but after KDevelop restart, we'll try to add the
               breakpoint using basically "watch *&(foo)".  I'm not sure if
               that's a problem or not.  */

Sounds like this will require more changes then, to store both, the user-
entered string and display that, but internally also store the absolute 
resolved path as an URL. Comments?

Bye

-- 
Milian Wolff
mail at milianw.de
http://milianw.de


More information about the KDevelop-devel mailing list