[erlang-questions] I need to call unexported functions from the erlang shell
Thu Jun 7 20:02:12 CEST 2007
(forgot to hit "reply to all" again...)
On 6/7/07, Olivier Sambourg <olivier.sambourg@REDACTED> wrote:
> A friendly warning: what follows may be crap and/or totally unsuited to
> your needs, but it's just an idea I had reading your mail.
> What about having two separate sets of beam files? One "production" set,
> and a "debug" set compiled with the +export_all compiler option (or
> Emakefile if you use them), both from the same source files.
> You could store the second set out of your code path. And when the need
> arises, you change the path (code:del_path / add_path) then load the
> module(s) you want to debug. When you're finished, change the path back and
> reload the module(s).
> Not something you'd wish to do everyday, but I believe it might work...
> And it's simple :)
> On 6/7/07, Luke Gorrie <luke.gorrie@REDACTED> wrote:
> > Howdy,
> > Just a friendly reminder -
> > I need to be able to call unexported functions from the Erlang shell.
> > I need to do this in lots of contexts - simple experimenting,
> > late-night troubleshooting on live networks, etc. This is not a
> > personal quirk, it's the nature of the work that we do at Synapse.
> > I would very much like a better way to accomplish this than adding
> > -compile(export_all) to all the modules, which is what we do today.
> > I hope one day Erlang adds a better option.
> > I have previously posted a parse_transform that creates a "back door"
> > for calling unexported functions and a patch to R9's erl_eval to use
> > it for the shell. This would be perfectly adequate except that I don't
> > like to use parse_transforms and interpreter hacks in production
> > systems and so we don't deploy this code on customer installations.
> > I know that there are implications for the compiler etc but these are
> > implementation details separate from the real-life requirement.
> > Cheers,
> > -Luke
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions