Bug 381506 - Clicking into "<command-line>:0:15:" in "Build view" opens empty file
Summary: Clicking into "<command-line>:0:15:" in "Build view" opens empty file
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: Output Views (show other bugs)
Version: 5.1.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-21 22:18 UTC by Piotr Mierzwinski
Modified: 2017-08-14 20:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2017-06-21 22:18:15 UTC
I met following error in compiler output ("Build view").
<command-line>:0:15: error: too many decimal points in number

When I click into it new empty file is opened
Comment 1 Christos Gourdoupis 2017-08-12 07:35:06 UTC
I suffer from this bug too. When I click on an error line from compiler output, a new empty file opens instead of the actual source file.
Are you using the Custom Buildsystem? And gcc?
Comment 2 Piotr Mierzwinski 2017-08-12 17:51:03 UTC
I don't use "Custom Buildsystem". I use cmake type project with make, default environment price and gcc.
Comment 3 Christos Gourdoupis 2017-08-13 10:43:03 UTC
Hmmm... ok I don't know how cmake works, never used it.
But I just found out that if `make` runs with --no-print-directory
option, kdevelop gets confused as to where gcc is based when it runs.
However if `make` prints lines like:
make[2]: Entering directory '<some directory>'
etc... then kdevelop finds and opens the relevant source file properly.
Comment 4 Piotr Mierzwinski 2017-08-13 17:52:05 UTC
In short, cmake only generating "Makefile", so finally, it is still run make command to build source code.
Comment 5 Kevin Funk 2017-08-13 17:55:12 UTC
This is build-system agnostic. We should just never attempt to open a new file when the output view is clicked. 

Check the code in kdevelop.git:outputview/outputmodel.cpp if you want to provide a patch for this issue.
Comment 6 Christos Gourdoupis 2017-08-13 23:45:43 UTC
Ok it's all clear now. Kdevelop simply parses the output from make and gcc to get the path to the source file. I used autotools and `make --no-print-directory` which deprived the parser of sufficient info as make descented into the subdirectories. I have found workarounds so I rest my case.
But Piotr uses cmake which seem to produce full absolute paths. 
Piotr can you post the actual error line that you are clicking on?
Comment 7 Piotr Mierzwinski 2017-08-14 20:44:42 UTC
As I mentioned in first post I clicked into line starting with:
<command-line>:0:15: error: 

I didn't check source code ("outputview/outputmodel.cpp"), but I suppose that parser checking clicked line just tries to find first occurrence of ':' and if it finds it, interprets all characters before as file name. Probably parser blindly assumes that before ':' always is present file name. That's why opens empty file (and probably wants to jump to row 0). Of course in this case should open nothing. I suppose that parser just . It isn't smart enough.

Anyway I reproduced error and I know what cased it.