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

Decompilation not working with OTP 20 using AtU8 chunk for ASCII atoms #772

Closed
afjackman opened this issue Aug 4, 2017 · 8 comments
Closed
Assignees
Milestone

Comments

@afjackman
Copy link

Hey - Autocomplete isn't working for me for standard modules - it only looks at local project modules for me (including modules in dependencies). I saw here #301 that it's supposed to be working. I'm on version 5.1, and I even tried reinstalling the plugin and restarting. Any idea what I might be doing wrong? Thanks.

@KronicDeth
Copy link
Owner

  1. Do you have your SDK setup?
  2. What IDE are you using?

@afjackman
Copy link
Author

  1. I believe I do. If I go into File -> Project Structure, I see Project SDK as "Elixir 1.4.5". In case this helps, I went to "Edit" and found that "/usr/local/Cellar/elixir/1.4.5". Just now, I also tried following the existing "Create project from existing sources" instructions to ensure that I followed setup steps precisely, but at step Fix blank line parsing #10 instead of showing "Next", I only have a "Finish" option, likely because my SDK is already set up.

  2. I am using IntelliJ IDEA 14.1.7.

@KronicDeth
Copy link
Owner

@tzveeJ somethings to check, can you see the decompiled modules? If you use the Shift Shift search, and type Kernel.beam, do you see Elixir.Kernel.beam and can you select it and it opens to decompiled code? Do you have any error indicator? It will be in the lower right corner of the window edge.

@afjackman
Copy link
Author

When I hit Shift Shift to search, I have to check off "Include non-project items" to get it to find Elixir.Kernel.beam, otherwise it doesn't find it. When I then open it, all I see is a file containing the text "Decompilated Error". I do not see an error indicator.

@KronicDeth
Copy link
Owner

KronicDeth commented Aug 7, 2017

Include non-project items is correct. Your SDK is not part of your project. It's a library.

Are you using OTP 20 or have the Elixir.Kernel.beam files installed with restrictive permissions @tzveeJ? "Decompilated error" occurs if any of the following

  1. The .beam file cannot be read
  2. The Atom chunk cannot be found
  3. The Atom chunk is too short
  4. The Atom chunk is empty, and so there is no 0th entry for the module name

You should be able to attach your Elixir.Kernel.beam (the one on the file system, not the decompiled one IntelliJ Elixir shows) to your next Github comment by putting it into a zip.

@afjackman
Copy link
Author

I am using OTP 20. I did not install Elixir with any restrictive permissions as far as I know. I installed using brew, and I'm on a Mac running Sierra. I'd be happy to check the permissions if you point me at how to do so.

Here is the file you asked for:
Elixir.Kernel.beam.zip

@KronicDeth KronicDeth changed the title Code Completion Not Working Decompilation not working with OTP 20 Aug 7, 2017
@KronicDeth KronicDeth added this to the v6.0.0 milestone Aug 7, 2017
@KronicDeth
Copy link
Owner

Added some extract information to the decompilation output when there's an error and it confirms that the OTP20 beams don't have an Atom chunk, which makes sense since a big feature of OTP20 was the addition of the UTF8 atom support, which added the new AtU8 chunk.

KronicDeth added a commit that referenced this issue Aug 7, 2017
KronicDeth added a commit that referenced this issue Aug 7, 2017
@KronicDeth KronicDeth changed the title Decompilation not working with OTP 20 Decompilation not working with OTP 20 using AtU8 chunk for ASCII atoms Aug 7, 2017
@afjackman
Copy link
Author

@KronicDeth Thanks for looking into this, I'm looking forward to the fix! Really enjoying the plugin otherwise, thanks x10!

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