New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support maps in the debugger #213
Conversation
|
Debugger support, very nice. =) Somehow I feel that dbg_ieval should use the erl_eval code alot more, it's tedious copy paste work. |
|
@psyeugenic The biggest WTF is the erl_eval_SUITE test suite in the debugger application. I thought it was an interpreted version of erl_eval_SUITE from stdlib, but not even. |
|
Patch has passed first testings and has been assigned to be reviewed |
|
I think this needs some work. Create the following: -module(t).
-compile([export_all]).
go() ->
M = #{ v => 1 },
loop(M, [1,2,3,4,5,6,7,8,9,10,11,12]).
loop(M, []) -> M;
loop(#{ v := U } = M, [V|Vs]) ->
loop(M#{ v := U + V }, Vs).Compile with 'debug_info'. Start the debugger: And Interpret with: Module -> Interpret -> "t.erl" Do you wanna take a look at it or do you defer to me? =) |
|
Will look at it tonight, completely forgot about patterns, ah ah. Sounds like GitHub doesn't highlight maps correctly, btw. |
|
Great! Btw, an easier way to test: #!/usr/bin/env escript
main(_) ->
io:format("~p~n",[go()]),
ok.
go() ->
M = #{ v => 1 },
loop(M, [1,2,3,4,5,6,7,8,9,10,11,12]).
loop(M, []) -> M;
loop(#{ v := U } = M, [V|Vs]) ->
loop(M#{ v := U + V }, Vs).And in bash shell: |
|
Oh really nice, didn't know about |
|
@psyeugenic Amended. Where should I put a test? |
|
Add a
foo(M) ->
if
is_map(M) -> yep;
true -> nope
end.Apparently I have to fix wx on my mac .. |
|
Will do. |
|
Patch has passed first testings and has been assigned to be reviewed |
|
@psyeugenic It doesn't really traverse BIF calls so no problem with guards, but I will put one in the test anyway. |
A test is commented-out in map_SUITE:t_update_exact/1, waiting for a fixed maps:update/3 function with correct integer/float semantics.
|
@psyeugenic Added a bunch of tests, there is one commented-out with regard to integer/float semantics in map keys. |
|
Goody! I'll add it to nightly builds. Yeah I know about the integer/float thingy. I'm working on it. |
|
Patch has passed first testings and has been assigned to be reviewed |
|
OTP-11673 |
No description provided.