[PATCH] preprocessing bug resulting in missing callgraphs

Dave Dodge <[email protected]>
Newsgroups gmane.text.doxygen.devel
Message-ID <20051219225617.GC23243@basmati>
This fixes a line counting bug in the doxygen preprocessor.

Symptom: References and callgraphs are sometimes not displayed for C
functions, even if explicitly requested.

Cause: The preprocessing code neglects to count linebreaks when it
encounters certain commands in a comment block.  #include directives
are replaced with line number directives based on this faulty counter.
The line directives affect the counter that is used to set up and
index contexts for later processing stages.  For example a \verbatim
before an #include in the file will cause the contexts to be indexed
with the wrong line numbers.  When the later stage that computes
function references needs the context, it looks it up using the
correct line count and fails to find it.  Therefore the references
list ends up empty, and therefore callgraphs are suppressed.

Index: doxygen-1.4.5/src/pre.l
===================================================================
--- doxygen-1.4.5.orig/src/pre.l	2005-09-18 13:01:10.000000000 -0400
+++ doxygen-1.4.5/src/pre.l	2005-11-11 12:11:20.000000000 -0500
@@ -1838,9 +1838,11 @@
 					  //g_commentCount++;
   					}
 <SkipCComment>[\\@][\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"|"f{"|"f$"|"f["){BN}+ {
+					  g_yyLineNr+=QCString(yytext).contains('\n');
   					  outputArray(yytext,yyleng);
   					}
 <SkipCComment>[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"){BN}+	{
+					  g_yyLineNr+=QCString(yytext).contains('\n');
   					  outputArray(yytext,yyleng);
 					  if (yytext[1]=='f')
 					  {


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.