Skip to content
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

Error when evaluating expression in debugger in Elixir 1.8.0 #1421

Closed
michallepicki opened this issue Mar 22, 2019 · 2 comments
Closed

Error when evaluating expression in debugger in Elixir 1.8.0 #1421

michallepicki opened this issue Mar 22, 2019 · 2 comments

Comments

@michallepicki
Copy link

michallepicki commented Mar 22, 2019

Describe the bug
Evaluating expression in debugger doesn't work with Elixir 1.8.0 or newer.
Elixir 1.8.0 and newer don't export :elixir.quoted_to_erl/3 anymore. Only :elixir.quoted_to_erl/2 is available.

To Reproduce
Steps to reproduce the behavior:

  1. Configure the project to use Elixir 1.8.0
  2. Place a breakpoint
  3. Run the debugger
  4. When suspended, click Evaluate expression
  5. Type some valid code
  6. Debugger crashes

Expected behavior
code gets evaluated

Logs

** (UndefinedFunctionError) function :elixir.quoted_to_erl/3 is undefined or private
    (elixir) :elixir.quoted_to_erl({:category, [line: 1], nil}, %Macro.Env{aliases: [], context: nil, context_modules: [], contextual_vars: [], current_vars: %{{:category, nil} => {0, :term}, {:filter, nil} => {0, :term}, {:session, nil} => {0, :term}}, file: "/filepath.ex", function: {:select_filter, 3}, functions: [{Kernel, [!=: 2, !==: 2, *: 2, +: 1, +: 2, ++: 2, -: 1, -: 2, --: 2, /: 2, <: 2, <=: 2, ==: 2, ===: 2, =~: 2, >: 2, >=: 2, abs: 1, apply: 2, apply: 3, binary_part: 3, bit_size: 1, byte_size: 1, ceil: 1, div: 2, elem: 2, exit: 1, floor: 1, function_exported?: 3, get_and_update_in: 3, get_in: 2, hd: 1, inspect: 1, inspect: 2, is_atom: 1, is_binary: 1, is_bitstring: 1, is_boolean: 1, is_float: 1, ...]}], lexical_tracker: nil, line: 126, macro_aliases: [], macros: [{Kernel, [!: 1, &&: 2, ..: 2, <>: 2, @: 1, alias!: 1, and: 2, binding: 0, binding: 1, def: 1, def: 2, defdelegate: 2, defexception: 1, defguard: 1, defguardp: 1, defimpl: 2, defimpl: 3, defmacro: 1, defmacro: 2, defmacrop: 1, defmacrop: 2, defmodule: 2, defoverridable: 1, defp: 1, defp: 2, defprotocol: 2, defstruct: 1, destructure: 2, get_and_update_in: 2, if: 2, in: 2, is_nil: 1, match?: 2, or: 2, pop_in: 1, ...]}], module: Mymodule, prematch_vars: :warn, requires: [Kernel, Kernel.Typespec], unused_vars: %{}, vars: [category: nil, filter: nil, session: nil]}, {:elixir_erl, nil, nil, false, %{{:category, nil} => {0, :_category@1}, {:filter, nil} => {0, :_filter@1}, {:session, nil} => {0, :_session@1}}, nil, [], %{category: 1, filter: 1, session: 1}, false})
    /tmp/intellij_elixir6/debugger/lib/intellij_elixir/debugger/server.ex:259: IntelliJElixir.Debugger.Server.handle_call/3
    (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message (from #PID<10473.5.0>): {:evaluate, %{env: %{file: "/filepath.ex", function: {:select_filter, 3}, line: 126, module: Mymodule}, expression: "category", pid: #PID<0.4175.0>, stack_pointer: 2}}
State: %IntelliJElixir.Debugger.Server{attached: #PID<10473.5.0>, evaluate_meta_pid_to_froms: %{}}
Client #PID<10473.5.0> is remote on node :"debuggerb121805e-0c71-447b-9b35-f082fc17e765@127.0.0.1"

Desktop:

  • OS: Ubuntu Linux
  • Version 18.04

Erlang:

  • Installer asdf
  • Version 21.2.3

Elixir:

  • Installer asdf
  • Version 1.8.1-otp-21

Plugin:

  • Version v10.3.0

Additional context
plugin code links to here: https://github.com/elixir-lang/elixir/blob/8a971fcb44391bd8b16456666f3033b633c6ff77/lib/elixir/src/elixir.erl#L256
where we can see :elixir.quoted_to_erl/3 on top of the file in exports, but on branch v1.8 it's gone and there's only quoted_to_erl/2:
https://github.com/elixir-lang/elixir/blob/v1.8/lib/elixir/src/elixir.erl#L7

@michallepicki
Copy link
Author

Awesome, thanks! Should we ask the Elixir team to have a stable documented interface for this kind of workflow?

@KronicDeth
Copy link
Owner

No, José has specifically told me that no one should be using these APIs and they are unsupported, but that he is fine if I use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants