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

DataTypeComponent.getLength - bits or bytes? #6498

Closed
Cazra opened this issue May 10, 2024 · 3 comments
Closed

DataTypeComponent.getLength - bits or bytes? #6498

Cazra opened this issue May 10, 2024 · 3 comments
Assignees
Labels
Feature: Documentation Status: Internal This is being tracked internally by the Ghidra team
Milestone

Comments

@Cazra
Copy link

Cazra commented May 10, 2024

Is DataTypeComponent's getLength() method supposed to return the length of the component in bits or bytes? I cannot find this documented anywhere.

@dragonmacher
Copy link
Collaborator

dragonmacher commented May 10, 2024

It is odd that the docs do not specify this. Taken from ghidra.program.model.data.DataType:

Get the length of this DataType as a number of 8-bit bytes.

@Cazra
Copy link
Author

Cazra commented May 10, 2024

Taken from ghidra.program.model.data.DataType:

Get the length of this DataType as a number of 8-bit bytes.

That would answer the question if DataTypeComponent were indeed a DataType, but unfortunately it is not. So, the semantics of DataTypeComponent.getLength are still uncertain. 🫤

@dragonmacher
Copy link
Collaborator

I verified that the way DataTypeComponent's length is set using, in some cases, the data type's length. This signaled that it is indeed byte-based.

@ryanmkurtz ryanmkurtz self-assigned this May 13, 2024
@ryanmkurtz ryanmkurtz added Feature: Documentation Status: Prioritize This is currently being prioritized Status: Internal This is being tracked internally by the Ghidra team and removed Status: Prioritize This is currently being prioritized labels May 13, 2024
@ryanmkurtz ryanmkurtz added this to the 11.2 milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Documentation Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

No branches or pull requests

3 participants