After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319998 - 'Referenced by' and 'References' section misses items
'Referenced by' and 'References' section misses items
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.4.x
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2005-10-27 17:10 UTC by Eric Fox
Modified: 2006-06-11 08:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Source files, config file, readme file and generated output (210.88 KB, application/octet-stream)
2005-10-27 17:13 UTC, Eric Fox
  Details
proposed patch to correctly parse member functions in conditionals (378 bytes, patch)
2006-04-01 02:10 UTC, Klaus Weidner
none Details | Review
Doxyfile config for example in comment #4 (9.74 KB, text/plain)
2006-04-01 02:17 UTC, Klaus Weidner
  Details
Example illustrating further issues with lexer (35.44 KB, application/x-compressed-tar)
2006-04-06 08:55 UTC, Janak Porwal
  Details

Description Eric Fox 2005-10-27 17:10:52 UTC
Please describe the problem:
Look at the documentation generated for NSXApp::OnIdle().
Doxygen stops generating information after it parses pgMotion->bInit().
Notice that ONIDLE_LIGHT and ToolMatching::init() are not listed in
the 'References" section.
As a result of this, the documentation generated for the ToolMatching::init()
method is also missing a 'Referenced by' section.

Test 1:

Replace '_atEvent.isOK()' with 'true', and rerun.
In this case, OnIdle gets fully parsed, and ToolMatching::init()
documentation is correctly generated to have a 
'Referenced by NSXApp::OnIdle()' section.

Test 2:

Replace 'pgMotion->bInit()' with 'true', and rerun.
In this case as well, OnIdle gets fully parsed, and ToolMatching::init()
documentation is correctly generated to have a 
'Referenced by NSXApp::OnIdle()' section.


Steps to reproduce:
1. Unzip the attached Zip file
2. Run the rundox.bat file
3. Observe the generated TestProj.chm file.


Actual results:
References section for a Member Function stops reporting Members and Functions 
it refers to after minimally complex references occur.

Expected results:
References section for a Member Function should list all its items.

Does this happen every time?
Yes

Other information:
Yes - I am attaching 'before' and 'after' chm files.
Comment 1 Eric Fox 2005-10-27 17:13:13 UTC
Created attachment 53957 [details]
Source files, config file, readme file and generated output
Comment 2 Eric Fox 2005-10-27 17:15:46 UTC
Doxygen Version: 1.4.5
Operating System: Windows XP Professional with Service Pack 2
Other Programs:
	ActivePerl Version 5.8.7 Build 813
	Graphviz   Version 2.6
	HTML Help  Version 1.3 (4.74.8702.0)
Comment 3 Klaus Weidner 2006-04-01 02:10:50 UTC
Created attachment 62503 [details] [review]
proposed patch to correctly parse member functions in conditionals

I can confirm this bug, the parser does not correctly handle member functions called inside if statements.

The problem is that the lexer doesn't increment the "{" count
for a member function called inside an if statement, which causes it to
think that the function is complete when encountering the next "}".
That's also why the source markup doesn't recognize member functions since
it thinks the objects are out of scope.

The attached patch fixes this for me, with no obvious ill effects in other locations.
Comment 4 Klaus Weidner 2006-04-01 02:12:53 UTC
Here's a minimal test case. The x->member() call in testfn() is missing from the "references" section, and doesn't get highlighted in the source view.

/** Example class. */
class Example {
        /** sample member. */
        member(int arg1, int arg2) {}

        /** predicate */
        bool predicate() { return false; }
};

/** test function.
 *  @param x The object
 */
void testfn(Example *x) {
        if (x->predicate()) {
                return;
        }

        x->member();
}
Comment 5 Klaus Weidner 2006-04-01 02:17:51 UTC
Created attachment 62504 [details]
Doxyfile config for example in comment #4

Doxygen config for example in #4. Nothing unusual in this one, you should also be able to reproduce it by putting the sample code into an existing project with reasonable settings.

Bug verified in HTML output when using doxygen 1.4.6 on Debian Linux, also verified that the proposed patch fixes it.
Comment 6 Eric Fox 2006-04-03 18:37:53 UTC
I compiled on Windows XP, and ran it on a large test case.  Your patch corrected the problem I was seeing.  The size of the .chm file generated from my test case increased from 42,120 KB to 45,697 KB.  The references sections look very much more accurate.  Thank you Klaus!
Comment 7 Dimitri van Heesch 2006-04-03 19:22:04 UTC
Patch has been included in CVS update "release-1.4.6-20060202".
Comment 8 Janak Porwal 2006-04-06 08:55:07 UTC
Created attachment 62835 [details]
Example illustrating further issues with lexer

Hi,
  There is still some problem with the lexer. Though the members called after
an if statement block appear in the "references" list, members called 
inside branches do no appear in the list.
   The attached code along with the sample output (*.txt files) illustrates the situation. (I have generated the text files by adding some extra code to 
to Definition::writeSourceRefList function, not affecting the function in any
other way, as I needed the reference relations explicitly for the product I am working on). The text files suffixed with _original illustrate the problem 
with the original release version, while those suffixed with _patced 
illustrate that the patch does not solve the problem completely (members
called inside branches still do not appear in the references list).
   It would be good if someone can fix the problem completely.


Thanks!
Janak
Comment 9 Dimitri van Heesch 2006-06-11 08:40:49 UTC
This is an automated message triggered by a new release of doxygen.

This bug has was marked as assigned, and therefore should be fixed with the new release (1.4.7).

Please check if this is indeed the case. 
If not then please reopen the bug report.