Module power_shell_cache

Loads abstract module code, either from debug_info *.beam chunk, or from *.erl source file.

Copyright © (c) WhatsApp Inc. and its affiliates. All rights reserved.

Behaviours: gen_server.

Authors: Maxim Fedorov (maximfca@gmail.com).

Description

Loads abstract module code, either from debug_info *.beam chunk, or from *.erl source file.

Caching server may not be started, in this case get_module() does not use caching logic and creates AST every call. If loaded module md5 hash is changed, or *.beam/*.erl file modification date is different from the last call, module AST gets reloaded from the corresponding file.

Data Types

function_clause()

function_clause() = {function, integer(), atom(), arity(), {clauses, erl_eval:clauses()}}

function_map()

function_map() = #{{atom(), arity()} => function_clause()}

Function Index

get_module/1Extracts AST of all functions defined in Mod.
start_link/0 Starts power_shell_cache server that keeps track of already decompiled modules.

Function Details

get_module/1

get_module(Mod::module()) -> function_map()

Extracts AST of all functions defined in Mod. Caches this if power_shell_cache server is running.

start_link/0

start_link() -> {ok, Pid::pid()} | ignore | {error, Reason::term()}

Starts power_shell_cache server that keeps track of already decompiled modules.


Generated by EDoc