Repository: ericsson/codechecker
Issue: Incorrect full path reconstruction for `-include`

```
$ mkdir /tmp/sa-test && cd /tmp/sa-test
$ touch input.c
$ mkdir header
$ echo zz > header/input.c
$ /usr/local/bin/clang -I/tmp/sa-test/header/ -include input.h -o /tmp/sa-test/input.o -c /tmp/sa-test/input.c
In file included from <built-in>:1:
/tmp/sa-test/header/input.h:1:1: error: unknown type name 'zz'
zz
^
/tmp/sa-test/input.c:1:1: error: expected identifier or '('
2 errors generated.
$ cat compile_commands.json 
[
{
  "directory": "/tmp/sa-test",
  "command": "/usr/local/bin/clang -I/tmp/sa-test/header/ -include input.h -o /tmp/sa-test/input.o -c /tmp/sa-test/input.c",
  "file": "/tmp/sa-test/input.c"
}
]
$ CodeChecker analyze --ctu /tmp/sa-test/compile_commands.json
[INFO 2019-11-23 12:30] - Pre-analysis started.
[INFO 2019-11-23 12:30] - Collecting data for ctu analysis.
[INFO 2019-11-23 12:30] - [1/1] input.c
[ERROR 2019-11-23 12:30] - Error generating AST.

command:

/usr/lib/llvm-10/bin/clang --target=x86_64-pc-linux-gnu -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include -c -x c -I/tmp/sa-test/header -include /tmp/sa-test/input.h /tmp/sa-test/input.c -std=gnu11 -emit-ast -D__clang_analyzer__ -w -o /tmp/clang-sa-reports/ctu-dir/x86_64/ast/tmp/sa-test/input.c.ast

stderr:

<built-in>:1:10: fatal error: '/tmp/sa-test/input.h' file not found
#include "/tmp/sa-test/input.h"
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

[ERROR 2019-11-23 12:30] - Error generating function map.

command:

/usr/lib/llvm-10/bin/clang-extdef-mapping /tmp/sa-test/input.c -- --target=x86_64-pc-linux-gnu -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include -c -x c -I/tmp/sa-test/header -include /tmp/sa-test/input.h -std=gnu11

stderr:

<built-in>:1:10: fatal error: '/tmp/sa-test/input.h' file not found
#include "/tmp/sa-test/input.h"
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error while processing /tmp/sa-test/input.c.
```

So upon seeing incomplete file path in `-include`, it just prepends `"directory"` field.
While clang proper has no issues finding the appropriate header.

Changed files:
analyzer/codechecker_analyzer/buildlog/log_parser.py

diff --git a/analyzer/codechecker_analyzer/buildlog/log_parser.py b/analyzer/codechecker_analyzer/buildlog/log_parser.py
index c1fb7bef..f8d4f9e3 100644
--- a/analyzer/codechecker_analyzer/buildlog/log_parser.py
+++ b/analyzer/codechecker_analyzer/buildlog/log_parser.py
@@ -672,8 +672,8 @@ def __collect_compile_opts(flag_iterator, details):
         # TODO: If Clang will be extended with an extra analyzer option in
         # order to print these absolute paths natively, this conversion will
         # not be necessary.
-        flags_with_path = ['-I', '-idirafter', '-imacros', '-imultilib',
-                           '-include', '-iquote', '-isysroot', '-isystem',
+        flags_with_path = ['-I', '-idirafter', '-imultilib',
+                           '-iquote', '-isysroot', '-isystem',
                            '-iwithprefix', '-iwithprefixbefore', '-sysroot',
                            '--sysroot']
         if flag in flags_with_path: