WindhoverLabs / juicer

5 stars 0 forks source link

Padding #7

Open lorenzo-gomez-windhover opened 3 years ago

lorenzo-gomez-windhover commented 3 years ago

Padding cannot be extracted directly from the DWARF. It becomes even more complex when structures have bit fields. It's not an impossible task, but assumptions and scope of padding capabilities need to be concretely defined since any incorrect behavior caused by padding logic can compromise the correctness of the database. And therefore compromise the reliability of any ground system using juicer.

This will be a work-in-progress for now. Might create a new branch dedicated to solving padding.

lorenzo-gomez-windhover commented 3 years ago

UPDATE: For symbols that do not have any bitfields, padding at the end of structures is added. The padding field is given the name of _spare_end.

TODO: Document these changes.

lorenzo-gomez-windhover commented 3 years ago

UPDATE: Support for padding in between fields of a structure has been added.

TODO:Add support for padding in structures that have bitfields. This should be handled almost the same way as structures without bitfields, however, the fields should be sorted by offset as these offsets may not follow ascending order when there is a bitfield inside a structure.