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

GoLand wrong binary content #40

Open
greenstatic opened this issue Jul 5, 2022 · 3 comments
Open

GoLand wrong binary content #40

greenstatic opened this issue Jul 5, 2022 · 3 comments

Comments

@greenstatic
Copy link

First, thank you for your awesome plugin, it really helps when debugging binary data.

I am using GoLand, Jetbrain's Intellij variant for the Go programming language.

It often happens when viewing "larger" (i.e. more than 10 bytes) byte slices, I get a subset of the "Show as Binary" view completely wrong. In the screenshot below the underlined content in the "Show as Binary" view does not correspond to the underlying bytes of a []byte slice.
Screen Shot 2022-07-05 at 5 05 37 PM

In this case it appears it replaces a "correct" byte with the series ef bf bd, although I'm not aware if this happens every single time when the plugin "fakes data".

This issue has occurred to me multiple times already with many different versions of GoLand.

Current setup:

  • GoLand 2021.3.4 (Build #GO-213.7172.22, built on March 15, 2022)
  • BinEd plugin version: 0.2.6
  • macOS 12.1

Any idea what could cause this behaviour?

@hajdam
Copy link
Member

hajdam commented Jul 5, 2022

Hi.
Reason is that plugin supports only some types of debug fields. With JetBrains platform there are specific classes for different programming languages and as far as I know no general API is provided to access field value directly.
I was able to implement some support for some languages, but even after many hours no luck for CLion and didn't even get to GoLand. As these IDE variants have got closed source, I was unable to identify any API to access value so far and to my knowledge there is no documentation about this either.

Implementation is visible here: https://github.com/exbin/bined-intellij-plugin/tree/master/src/org/exbin/bined/intellij/debug

In fallback mode plugin uses toString() method to at least access available String value without any knowledge if it contains binary data. Such value can have limited length and as it is UTF-8 text, values not convertible to single character are replaced with longer codes or character for "unknown unicode code" - which is what happens here.

@greenstatic
Copy link
Author

Ahh, ofc, UTF-8 replacement character.

Thanks @hajdam for your detailed description. If I'll have any free time in the not so distant future, I'll try to help out.

@hajdam
Copy link
Member

hajdam commented Dec 8, 2022

Released version 0.2.7 with added support for some debug fields extracting data from GUI tree - might be usable for some small arrays if you want to try it...

I still didn't find proper way to access values for GoLand thou...

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

No branches or pull requests

2 participants