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

remove overriding the bitmask when not found in dwarf #30

Merged
merged 1 commit into from
May 20, 2024

Conversation

louiscaron
Copy link

This happens when I want to update the characteristics addresses from the elf file. If the symbol referenced by the characteristic is found not to be a bitfield then the bit_mask is removed from characteristic definition.

But in my case (and potentially all cases), when the symbol is not a bitfield, it is still an integer on which the characteristic itself it a bit field in that symbol. In the code, the offset and masking operations are hardcoded on the integer but semantically there are several "characteristics" mapped to the same integer with different bit_masks.

@DanielT DanielT merged commit 40f584c into DanielT:master May 20, 2024
1 check passed
@DanielT
Copy link
Owner

DanielT commented May 20, 2024

Sadly this looks like a situation where it is impossible to always be correct for everyone.

Sooner or later someone is going to change the datatype of a variable in their program from bitfield to integer, and will be surprised that the a2l information is not corrected.
On the other hand, the A2L format was not designed to have all its information automatically derived from the debug info, so we have to expect that information will be manually added to these files.

Keeping wrong information seems like a smaller problem than deleting correct information, so I've chosen to accept your change.

@louiscaron
Copy link
Author

louiscaron commented May 20, 2024 via email

@DanielT
Copy link
Owner

DanielT commented May 20, 2024

I rarely get feedback, so I'm very happy that you like the tool.

In my opinion, the update-preserve option controls a separate concern. Just because you want to keep the bitfield setting does not necessarily mean you want to also keep the settings for deleted variables.

Essentially this would have to be a new option.
However, I am reluctant to add options, because I think a wall of options makes a tool harder to use for new users.

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

Successfully merging this pull request may close these issues.

2 participants