SourceForge has been redesigned. Learn more.

#43 misses some refernces to symbols.

genxref (49)

LXR version 0.91 I think - downloaded it from
sourceforge about 2 weeks ago. There doesn't seem to be
any version info in any of the files. Latest entry in
CHANGELOG is '2002-02-03 11:29 mbox'

No error messages. Using mysql db. Indexing plain files.

The bug:
I have a C file with the line

ct += kill_task(ptask, sig, 0); /* ANUPBS */

When I run genxref on the project containing this file
it fails to find the reference to kill_task. If you
look at the 'useage' table in mysql there's no entry
for that symbol in that file.

If I change the line to

ct += kill_task(ptask, sig, 0);

and rerun genxref it seems to work just fine - genxref
finds the reference to kill_task, there's an entry in
useage, and an identifier search in the browser finds it.

A problem with the C comment parsing perhaps?
David Houlder


  • Malcolm Box

    Malcolm Box - 2002-05-21

    Logged In: YES

    There are definitely some problems in the referencing code -
    several people have reported missing references.

    The problem seems to lie in the LXR::SimpleParse and
    Generic::referencefile() code which is rather unclear and
    depends on some fairly dodgy regexps.

    If you wanted to spend some time stepping through this code
    and isolating the bug it would be very useful.

  • Nobody/Anonymous

    Logged In: NO

    This problem has annoyed me enough that I tracked it down.
    The problem seems to be with LXR/Lang/, line 168:

    @lines = \($frag =~ /\(.\*?\n\)/g, $frag =~ /\[^\n\]\*$/\);

    specifically, the second regexp match. When LXR hits an
    expression that ends in /* comment */, then the $frag will
    not end in a newline.

    The fix is trivial, just put parens around the second regexp
    like this:

    @lines = \($frag =~ /\(.\*?\n\)/g, $frag =~ /\(\[^\n\]\*\)$/\);

    For curiosity's sake I ran the old and new versions against
    the redhat 7.3 linux kernel, and it catches an extra 99
    references to jiffies. Interestingly, it looks like lines
    containg quoted text also were subject to this problem.

    I'll submit a patch for this.

  • Malcolm Box

    Malcolm Box - 2002-07-29

    Logged In: YES

    Fixed in CVS

  • Malcolm Box

    Malcolm Box - 2002-07-29
    • status: open --> closed-fixed

Log in to post a comment.