Wrapping routines
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
Wrapping routines         


Author: Arjen Markus
Date: Nov 12, 2007 12:42

Hello,

My question requires a rather lengthy preparation:

I have been experimenting a bit with wrapping a library, that is,
I wanted to see if it is possible to place some other code between
the library routines and the calling program without actually changing
the source code of either.

For instance:

My program uses a routine sub_a. I want to see how sub_a is actually
called (with what parameters) and what the results are. But I do not
have the source code for it or I do not want to mess with it.

The strategy I follow is:
Show full article (4.13Kb)
4 Comments
Re: Wrapping routines         


Author: nospam
Date: Nov 12, 2007 13:03

Arjen Markus wrote:
> - routine sub_a is part of a module mod_a.
...
> - I now have a third module - with the same name "mod_a"...
[and he made it work]
> My question is:
> Is this a mere coincidence? Or is this actually supposed to work this
> way?

No, and no. Those aren't two opposite choices.

I would not say that it was a coincidence. It seems like a direct
consequence of some possible implementation choices. No, I don't know
the details of implementation that makes this work, but I'm quite
willing to take your word for it that you managed to make it work with
those compilers.

But it definitely is not "supposed" to work. Having two modules with the
same name is a clear violation of the standard. That's not even worth
the effort for me to look up and copy the citation; it isn't exactly a
subtle case.
Show full article (1.54Kb)
no comments
Re: Wrapping routines         


Author: Fei Liu
Date: Nov 12, 2007 13:23

Arjen Markus wrote:
> Hello,
>
> My question requires a rather lengthy preparation:
>
> I have been experimenting a bit with wrapping a library, that is,
> I wanted to see if it is possible to place some other code between
> the library routines and the calling program without actually changing
> the source code of either.
>
> For instance:
>
> My program uses a routine sub_a. I want to see how sub_a is actually
> called (with what parameters) and what the results are. But I do not
> have the source code for it or I do not want to mess with it.
>
> The strategy I follow is:
>
> - routine sub_a is part of a module mod_a.
> - I write a routine sub_b (part of a module mod_b) that calls sub_a. ...
Show full article (2.53Kb)
no comments
Re: Wrapping routines         


Author: Arjen Markus
Date: Nov 12, 2007 21:27

On 12 nov, 22:03, nos...@see.signature (Richard Maine) wrote:
> Arjen Markus wrote:
>> - routine sub_a is part of a module mod_a.
> ...
>> - I now have a third module - with the same name "mod_a"...
>
> [and he made it work]
>
>> My question is:
>> Is this a mere coincidence? Or is this actually supposed to work this
>> way?
>
> No, and no. Those aren't two opposite choices.
>
> I would not say that it was a coincidence. It seems like a direct
> consequence of some possible implementation choices. No, I don't know
> the details of implementation that makes this work, but I'm quite
> willing to take your word for it that you managed to make it work with
> those compilers.
> ...
Show full article (1.81Kb)
no comments
Re: Wrapping routines         


Author: Arjen Markus
Date: Nov 12, 2007 21:31

On 12 nov, 22:23, Fei Liu gmail.com> wrote:
> Arjen Markus wrote:
>> Hello,
>
>> My question requires a rather lengthy preparation:
>
>> I have been experimenting a bit with wrapping a library, that is,
>> I wanted to see if it is possible to place some other code between
>> the library routines and the calling program without actually changing
>> the source code of either.
>
>> For instance:
>
>> My program uses a routine sub_a. I want to see how sub_a is actually
>> called (with what parameters) and what the results are. But I do not
>> have the source code for it or I do not want to mess with it.
>
>> The strategy I follow is:
>
>> - routine sub_a is part of a module mod_a. ...
Show full article (3.03Kb)
no comments