You are not logged in.
Pages: 1
I'm working on a project that is turning into a real "dog's breakfast" of code spread over 25 C source files. Its reached the stage where I can't keep track of where anything is.
I've tried a couple of code analysers but the mess overpowers them.
Does anyone know of a tool that could handle such a mess?
Offline
I've heard that once a project hits about 10,000 lines of code, it becomes too much for one developer to keep track of everything in their head. So for dealing with my 1.5-million-line project at work, my favourite tool it "git grep". If you're not using git, a simple "grep -r <pattern/function/etc.> ." usually suffices to locate anything you want.
Offline
Are you saying that you put functions at random places in the 25 files?
Anyway I'm using Code::Blocks and it has menu entries for finding implementation/occurences of functions and variables, which might help.
Offline
If you are using Emacs, look up Tags in the emacs info documentation. My preferred way to generate an Emacs tag table for the Scheme 48 source tree was:
find . |grep -e '\.(c|h|scm)' |etags -
(On Arch, you will need to replace etags with etags.emacs in the above command (or make a symlink in a directory on your path).)
If you need to hunt down call sites as well, grep -Finre 'SEARCH-STRING' . is handy. (I used -Fi to deal with question marks and the case-insensitivity of Scheme; for a C-only project, drop them.)
So for dealing with my 1.5-million-line project at work,
Eeeeek.
Offline
Are you saying that you put functions at random places in the 25 files?
Anyway I'm using Code::Blocks and it has menu entries for finding implementation/occurences of functions and variables, which might help.
Not I, its a yahoo chat client I made a fork of years ago. Recent authentication changes have forced me into a major update.
The is so much indirection its almost impossible to follow the flow.
Offline
Ah, I see what you mean... I hate this too. Often happens in "object-oriented" languages where people like to create classes just for the sake of it; I'm a bit surprised to see this happen in C.
Last time I had trouble understanding a piece of code, I wrote down a description of all the classes, what they did, which classes they used... That helped, but then there was only 6 of them or so. Maybe doxygen could help.
Offline
Have you tried cflow?
Offline
Have you tried cflow?
Yes it choked on the indigestable mess, though that may be attributable to PEBKAC, was quite a while ago
Offline
cscope can help you find things. It's very useful if you are using vim, but can give you info from CLI, as well. ctags, cflow and doxygen are useful as well. YMMV, as I usually don't break 15 files in a project.
Offline
We use cscope at work for tagging, and we have thousands of source files in hundreds of directories. It handles it fine.
Offline
If the application you're running is under Linux, you can generate a dynamic chart using valgrind+callgrind+kcachegrind.
Or, you may try use doxygen to extract all functions/classes/calls/... it's my tool of choice regarding statical code analysis.
Offline
Pages: 1