ruben2020/codequery

Issues with called function results

Tupperware69 opened this issue · 1 comments

I am using codequery in CLI mode (Windows, but running under cygwin) to parse a set of C code to identify control/data couples. Generally the tool works as expected, however, for some files I am getting incorrect results for the called function query.

For example, cqsearch -s myproject.db -p 7 FNAME_A

This gives me the list of functions I expect but then includes some more function calls which do not relate or that function (or that C file). The function calls do, however, relate to the next function in my list (alphabetically) e.g. FNAME_B. This can be identified because the line numbers for the function calls are increasing for the correct calls and then reduce and start increasing again.

For example I get:
FNAME_A Calls P @ line 43
FNAME_A Calls Q @ line 58
FNAME_A Calls R @ line 64
FNAME_A Calls X @ line 32 <-- incorrect calls start here
FNAME_A Calls Y @ line 69
FNAME_A Calls Z @ line 78

If I run cscope -dL2FNAME_A (use same cscope.out that generated myproject.db) on the same set of files I get the correct result (in the above example P/Q/R are the calls)

Although cscope returned the correct result in this instance, during my debugging I have seen similar behaviour with cscope as well (initial reason for moving to codequery). The results returned seemed to vary based on the directory the source files were located....all very confusing.

I was hoping someone might have some insight to this issue and possibly some advice on a resolution.

Thanks

Ignore this issue report, adding -e to the options list resolved the problem.

Thanks.