bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

function call via pointer


From: Hideki IWAMOTO
Subject: function call via pointer
Date: Mon, 05 Apr 2004 01:00:01 +0900

When a function pointer is used for call, gctags doesn't pick up it as a symbol.

EXAMPLE:
#global -sx direct_IO
direct_IO         671 fs/block_dev.c    direct_IO: blkdev_direct_IO,
direct_IO         617 fs/ext2/inode.c   direct_IO: ext2_direct_IO,
direct_IO         348 fs/jfs/inode.c    .direct_IO      = jfs_direct_IO,
direct_IO        2239 fs/reiserfs/inode.c     direct_IO: reiserfs_direct_io,
direct_IO        1250 fs/xfs/linux/xfs_aops.c   .direct_IO              = 
linvfs_direct_IO,
direct_IO         402 include/linux/fs.h        int (*direct_IO)(int, struct 
inode *, struct kiobuf *, unsigned long, int);
direct_IO        1621 mm/filemap.c      return mapping->a_ops->direct_IO || 
mapping->a_ops->direct_fileIO;
#global -gx -e '->direct_IO\('
->direct_IO\(    1631 mm/filemap.c      return mapping->a_ops->direct_IO(rw, 
mapping->host, iobuf, offset, blocksize);


Calls via pointer can be picked up by following modification.
However, all calls of function defined outside the source tree (standard 
library etc)
come to be picked up as symbol by this modification. I do not know whether this 
becomes a problem.

Index: gctags/C.c
===================================================================
RCS file: /cvsroot/global/global/gctags/C.c,v
retrieving revision 1.39
diff -u -r1.39 C.c
--- gctags/C.c  27 Jun 2003 15:51:33 -0000      1.39
+++ gctags/C.c  4 Apr 2004 15:32:13 -0000
@@ -111,8 +111,13 @@
                                        if (target == REF && defined(token))
                                                PUT(token, lineno, sp);
                                } else if (level > 0 || startmacro) {
-                                       if (target == REF && defined(token))
-                                               PUT(token, lineno, sp);
+                                       if (target == REF) {
+                                               if (defined(token))
+                                                       PUT(token, lineno, sp);
+                                       } else if (target == SYM) {
+                                               if (!defined(token))
+                                                       PUT(token, lineno, sp);
+                                       }
                                } else if (level == 0 && !startmacro && 
!startsharp) {
                                        char arg1[MAXTOKEN], savetok[MAXTOKEN], 
*saveline;
                                        int savelineno = lineno;
Index: gctags/Cpp.c
===================================================================
RCS file: /cvsroot/global/global/gctags/Cpp.c,v
retrieving revision 1.37
diff -u -r1.37 Cpp.c
--- gctags/Cpp.c        6 Jan 2004 06:59:15 -0000       1.37
+++ gctags/Cpp.c        4 Apr 2004 15:32:13 -0000
@@ -115,8 +115,13 @@
                                        if (target == REF && defined(token))
                                                PUT(token, lineno, sp);
                                } else if (level > stack[classlevel].level || 
startequal || startmacro) {
-                                       if (target == REF && defined(token))
-                                               PUT(token, lineno, sp);
+                                       if (target == REF) {
+                                               if (defined(token))
+                                                       PUT(token, lineno, sp);
+                                       } else if (target == SYM) {
+                                               if (!defined(token))
+                                                       PUT(token, lineno, sp);
+                                       }
                                } else if (level == stack[classlevel].level && 
!startmacro && !startsharp && !startequal) {
                                        char savetok[MAXTOKEN], *saveline;
                                        int savelineno = lineno;

----
Hideki IWAMOTO  address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]