DanielT / a2ltool

A tool to edit, merge and update a2l files
Apache License 2.0
46 stars 15 forks source link

remove overriding the bitmask when not found in dwarf #30

Closed louiscaron closed 3 months ago

louiscaron commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

Thanks a lot, actually I was wondering if I should tie this behaviour to the update-preserve option. I did not implement it because I thought it was a little bit misleading.  If you want I can add it.  Congratulations for the tool! I am using it to learn rust and I enjoy it a lot. I am impressed by the processing speed as I had started to implement this feature in python. Louis

Yahoo Mail : Recherchez, organisez, maîtrisez

Le lun., mai 20, 2024 à 19:04, Daniel @.***> a écrit:

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.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

DanielT commented 3 months ago

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.