Attributes of loaded modules

Ulf Wiger etxuwig@REDACTED
Thu May 15 15:48:43 CEST 2003


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




More information about the erlang-questions mailing list