Re: circular dependency - some tools ?

From: archibald (glop00.5.archibald_at_spamgourmet.com)
Date: 10/08/03


Date: Wed, 08 Oct 2003 00:43:52 +0200

Martin Blume wrote:

Thanks for your reply.

>
> I guess the loading of the other module then takes place immediately
> if you access an exported variable, if it is not already loaded. I
> think you have to rework your code and:
> (a) put all into one module
Precisely It's what I don't want.

> or
> (b) extract some parts of module1 and some parts of module2, put
> them into base_module, then load base_module first, then module1 and
> module2. Both depend then on base_module only, not on each other and
> base_module does not depend on either module1 or module2.
Ok, you are right and perhaps I'll have to do that later but at present
I'm choosing another way because I don't want to rework my code too
much, I don't have enough time to do this. I preferred to create a new
struct which contains pointers on function. I initialize this struct in
one of my module with all functions ( which are in this module ) I want
to use in my another module. I'm using a global kernel pointer which I
can have access in my two modules to pass my struct. I think processing
like that should be work.

So to help newbies like me, I want to come back to my initiale question
which was : how I can find symbols that do circular dependency when I
load my modules ? Finally I've managed to solve this problem, we have to
use :

nm -u module.o

> So whatever tools there are (cxref, ctags), you'd still have to
> redesign your modules and touch the source code.
I tried cxref but it crashes, I tried cscope but it gives incoherent
result.
I haven't tried ctags but freescope works like a charm.