Attributes of loaded modules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Attributes of loaded modules

Gerd Flaig-2
Hi,

how can I get information about currently loaded modules? I found out
about code:is_loaded(foomodule)  which gives me the filename of the
beam file the module was loaded from.

Is there a way to ask if a certain module was compiled with
debug_info?

      Goodbyte, Gerd.
--
Gerd Flaig                     Technik                gerd
Bei Schlund + Partner AG       Brauerstra?e 48      D-76135 Karlsruhe
 Physics is like sex: sure, it may give some practical results,
 but that's not why we do it. -- Richard Feynman


Reply | Threaded
Open this post in threaded view
|

Attributes of loaded modules

Ulf Wiger-4

Each erlang module has a generated function, module_info(),
which will give you lots of information about the module:

Eshell V5.2.3.3  (abort with ^G)
1> queue:module_info().
[{exports,[{new,0},{in,2},{out,1},{to_list,1},{module_info,0},{module_info,1}]},
 {imports,[]},

{attributes,[{vsn,[87737766660651954626331902793218912050]}]},
 {compile,[{options,[v3,
                     debug_info,

{i,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../../kernel/include"},

{i,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../include"},

{outdir,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../ebin"},

{cwd,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src"}]},
           {version,"4.1.1"},
           {time,{2003,3,13,10,40,2}}]}]


There is also a short form in the shell, m(Module). Note
that it formats output and then returns 'ok'.

2> m(queue).
Module queue compiled: Date: March 13 2003, Time: 10.40
Compiler options:  [v3,
                    debug_info,

{i,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../../kernel/include"},

{i,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../include"},

{outdir,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../ebin"},

{cwd,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src"}]
Object file:
/EDUP/Erlang/R9B-1/lib/erlang/lib/stdlib-1.11.4.1/ebin/queue.beam
Exports:
         in/2
         module_info/0
         module_info/1
         new/0
         out/1
         to_list/1
ok


The Module:module_info/1 function will give you a specific
subset of the module_info() information:

3> queue:module_info(compile).
[{options,[v3,
           debug_info,

{i,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../../kernel/include"},

{i,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../include"},

{outdir,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src/../ebin"},

{cwd,"/home/pkx-macr/wrk/otp/otp_src_R9B-1/lib/stdlib/src"}]},
 {version,"4.1.1"},
 {time,{2003,3,13,10,40,2}}]


/Uffe


On Thu, 15 May 2003, Gerd Flaig wrote:

>Hi,
>
>how can I get information about currently loaded modules? I found out
>about code:is_loaded(foomodule)  which gives me the filename of the
>beam file the module was loaded from.
>
>Is there a way to ask if a certain module was compiled with
>debug_info?
>
>      Goodbyte, Gerd.
>

--
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes



Reply | Threaded
Open this post in threaded view
|

Attributes of loaded modules

Gerd Flaig-2
Ulf Wiger <etxuwig> writes:

> Each erlang module has a generated function, module_info(),
> which will give you lots of information about the module:

thank you, this was most helpful.

     Goodbyte, Gerd.
--
Gerd Flaig                     Technik                gerd
Bei Schlund + Partner AG       Brauerstra?e 48      D-76135 Karlsruhe
 Physics is like sex: sure, it may give some practical results,
 but that's not why we do it. -- Richard Feynman