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

Unable to open byte array when debugging #47

Open
midoriiro opened this issue Nov 6, 2022 · 7 comments
Open

Unable to open byte array when debugging #47

midoriiro opened this issue Nov 6, 2022 · 7 comments

Comments

@midoriiro
Copy link

Could be useful to open binary editor for certain type of variable like byte array when debugging code. I'm using Rider, I don't know if that already implemented for Idea or other Jetbrains IDE's.

Any thought about it ?

@hajdam
Copy link
Member

hajdam commented Nov 6, 2022

Hi,
support for byte array variables is implemented only for some JetBrains IDEs due to private access to variable values and different implementations for each programming language - api only provides toString() and GUI list of child items for debugger tree...
Currently Java, Python and PHP is supported and I already lost many hours while unsuccessfully trying to support C/C++ and Go...

I might try to take a look on how the C# is implemented if any reasonable method is available...

@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 Rider thou...

@midoriiro
Copy link
Author

I just tested it, like you said its working for small array. For large array it seem working but when I scroll down the UI freezing (I'm talking about +100K bytes in array). Do you think implementing a buffered/stream array read implementation could be possible for that use case ?

Thank for your time.

@hajdam
Copy link
Member

hajdam commented Dec 8, 2022

I didn't find any stream API methods there in many wasted hours. It might be there, but:

  • I don't think such API is documented anywhere
  • Rider is closed source and has obfuscated code
  • Analyzing / decompiling code is very hard and probably not allowed by license anyway

Probably best approach would be to ask JetBrains for documentation / request API addition / pay for it or something.
I have only free license from their open-source development program and I don't use Rider personally. My question about this on Slack was not responded to, so it is what it is...

@hajdam
Copy link
Member

hajdam commented Dec 8, 2022

I asked for advice in JetBrain's YouTrack: https://youtrack.jetbrains.com/issue/RIDER-62867/Hex-Viewer-Like-debugger-view

@midoriiro
Copy link
Author

I'm not familiar with Jetbrains API and their IDEs plugin development. But what I meant by "buffered/stream array read implementation" is to implement in the UI to read the bytes array (provided by the debugger if understand correctly) in a stream way.

Lets take an example of a binary viewer with 8 bytes/rows, the viewport show the first 20 rows, then the first 160 bytes are loaded and shown by the UI. If you scroll up/down then the UI load another part of the bytes array.

I implemented that kind of behavior for a matrix which can contains a huge amount of data for another project. This could be a possible and efficient solution, but if that caused the UI to froze is not caused by the UI code it'll not help.

I try to dig a little on the code of the plugin, I did not find anything related to the UI. The UI is provided by Jetbrains SDK or I missing something ?

@hajdam
Copy link
Member

hajdam commented Dec 9, 2022

Code related to debug fields is in https://github.com/exbin/bined-intellij-plugin/tree/master/src/org/exbin/bined/intellij/debug
and it's mostly a mess...

I typically use caching/double paging with 4k chunks of data and it works fine for IntelliJ IDE variant.

Except for .NET I didn't find any method to access specific part of the data - currently used method is to force load more rows into debug view tree UI on the IDE side - it's ugly hack and is causing freezing. Feel free to try to find better way...

UI stuff is typically in gui directories (packages) - not sure what are you missing. Main hex UI component is library / in separate repository https://github.com/exbin/bined-lib-java

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