aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-04-26 12:47:41 +0200
committerGitHub <[email protected]>2017-04-26 12:47:41 +0200
commita46b05d3fd38c76824faf4eccba0f2117abd9bff (patch)
tree3d88cdc035ca32434ecd92fcbac9ab20568d1318 /erts/preloaded/src
parent9ded73921e8a6a5ecf00c27028fcff1bf1961992 (diff)
parent9dfb4eda78ade372ff5055b618612e478dc900e6 (diff)
downloadotp-a46b05d3fd38c76824faf4eccba0f2117abd9bff.tar.gz
otp-a46b05d3fd38c76824faf4eccba0f2117abd9bff.tar.bz2
otp-a46b05d3fd38c76824faf4eccba0f2117abd9bff.zip
Merge pull request #1367 from josevalim/jv-dbgi-chunk
Introduce new "Dbgi" chunk OTP-14369
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/add_abstract_code14
1 files changed, 7 insertions, 7 deletions
diff --git a/erts/preloaded/src/add_abstract_code b/erts/preloaded/src/add_abstract_code
index 943987872e..f53791cdc2 100644
--- a/erts/preloaded/src/add_abstract_code
+++ b/erts/preloaded/src/add_abstract_code
@@ -28,12 +28,12 @@
main([BeamFile,AbstrFile]) ->
{ok,_,Chunks0} = beam_lib:all_chunks(BeamFile),
{ok,Abstr} = file:consult(AbstrFile),
- Chunks1 = lists:keyreplace("Abst", 1, Chunks0,
- {"Abst",term_to_binary({raw_abstract_v1,Abstr})}),
- {"CInf",CInf0} = lists:keyfind("CInf", 1, Chunks1),
- CInf = fix_options(CInf0),
- Chunks = lists:keyreplace("CInf", 1, Chunks1, {"CInf",CInf}),
- {ok,Module} = beam_lib:build_module(Chunks),
+ {"CInf",CInf0} = lists:keyfind("CInf", 1, Chunks0),
+ {CInf, COpts} = fix_options(CInf0),
+ Chunks1 = lists:keyreplace("CInf", 1, Chunks0, {"CInf",CInf}),
+ Chunks2 = lists:keyreplace("Dbgi", 1, Chunks1,
+ {"Dbgi",term_to_binary({debug_info_v1,erl_abstract_code,{Abstr, COpts}})}),
+ {ok,Module} = beam_lib:build_module(Chunks2),
ok = file:write_file(BeamFile, Module),
init:stop().
@@ -42,4 +42,4 @@ fix_options(CInf0) ->
{options,Opts0} = lists:keyfind(options, 1, CInf1),
Opts = Opts0 -- [from_asm],
CInf = lists:keyreplace(options, 1, CInf1, {options,Opts}),
- term_to_binary(CInf).
+ {term_to_binary(CInf), Opts}.