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

[Feature] add bitarray to data types #167

Closed
zocker-160 opened this issue Apr 28, 2022 · 5 comments
Closed

[Feature] add bitarray to data types #167

zocker-160 opened this issue Apr 28, 2022 · 5 comments
Labels
feature A new feature
Milestone

Comments

@zocker-160
Copy link

zocker-160 commented Apr 28, 2022

It would be really useful to have bitarray as a data type available so that for example 0x8030 would show as [1000000000110000]

grafik

@solemnwarning solemnwarning added the feature A new feature label Apr 29, 2022
@solemnwarning
Copy link
Owner

solemnwarning commented Apr 29, 2022

I wonder how much overlap there is between this and #155.

I could solve this (and some of #155's cases) by adding types for <8 bit values, but to cover all cases really we need to either be able to define types on a bit boundary, or make it possible for each instance of a data type to have associated data - for example defining the data type of a particular byte to be split up as 1:3:2:2 bit words. This probably ties into if/how to do bitfields in the templates too.

Just thinking out loud.

EDIT: Also values that span byte boundaries too of course, because the world is crazy.

@zocker-160
Copy link
Author

I think this is similar to #155, because displaying like I tried to show in the image above could also add the ability to edit it.

Being able to split it up into smaller bit words would be nice as well I think.

@solemnwarning
Copy link
Owner

This has been waiting a while, but finally underway on the branch where I'm refactoring everything to support bit-aligned sizes/offsets!

image

I'm debating how this should look - do you think it should retain the hex/text columns on either side like the disassembly (pictured), or utilise the entire row for binary?

@zocker-160
Copy link
Author

If you ask me, I think it should behave the same as any other data type.
For example when I select an s8 it looks like this currently:
Screenshot_20240224_163904

So when selecting type "bitarray" instead, I would expect [11111111] on the left (instead of [-1] and e.g. <bitarray8> on the right (instead of <s8>)

solemnwarning added a commit that referenced this issue Feb 25, 2024
Mostly-working and thrown together for testing bit-aligned cursor
handling, editing, highlighting and keyboard navigation aren't fully
implemented yet.
@solemnwarning solemnwarning added this to the 0.62.0 milestone Mar 9, 2024
@solemnwarning
Copy link
Owner

Merged to master along with a boatload of refactoring to support bit-precision offsets for the cursor position, selections, comments, data type definitions, etc.

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

No branches or pull requests

2 participants