DanielT / a2ltool

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

read elf file error #31

Closed Monf1a closed 3 months ago

Monf1a commented 3 months ago

Hi, DanielT When I update the address in the a2l file using a2ltool, the command line prompts me to read the type: Failed to read type: missing struct byte size attribute DW_TAG_pointer_type @0x1516AFE DW_TAG_const_type @0x1516B04 DW_TAG_typedef EcuM_ConfigType @0x15163A9 DW_TAG_structure_type @0x151630F DW_TAG_typedef EcuM_Cfg_adrModuleInitRef_t @0x15162EC DW_TAG_structure_type @0x15159CB DW_TAG_pointer_type @0x151621B DW_TAG_const_type @0x1516221 DW_TAG_typedef CanTp_ConfigType @0x15133D8 DW_TAG_structure_type CanTp_ConfigStructType @0x15133F0 Failed to read type: missing struct byte size attribute DW_TAG_pointer_type @0x1516AFE DW_TAG_const_type @0x1516B04 DW_TAG_typedef EcuM_ConfigType @0x15163A9 DW_TAG_structure_type @0x151630F DW_TAG_typedef EcuM_Cfg_adrModuleInitRef_t @0x15162EC DW_TAG_structure_type @0x15159CB DW_TAG_pointer_type @0x15162B5 DW_TAG_const_type @0x15162BB DW_TAG_typedef J1939Tp_ConfigType @0x1514ADE DW_TAG_structure_type J1939Tp_ConfigStructType @0x1514AF8 Failed to read type: missing struct byte size attribute DW_TAG_const_type @0x20D9644 DW_TAG_typedef EcuM_ConfigType @0x20D8F91 DW_TAG_structure_type @0x20D8EF7 DW_TAG_typedef EcuM_Cfg_adrModuleInitRef_t @0x20D8ED4 DW_TAG_structure_type @0x20D85B3 DW_TAG_pointer_type @0x20D8E03 DW_TAG_const_type @0x20D8E09 DW_TAG_typedef CanTp_ConfigType @0x20D5FC0 DW_TAG_structure_type CanTp_ConfigStructType @0x20D5FD8 Failed to read type: missing struct byte size attribute DW_TAG_const_type @0x20D9644 DW_TAG_typedef EcuM_ConfigType @0x20D8F91 DW_TAG_structure_type @0x20D8EF7 DW_TAG_typedef EcuM_Cfg_adrModuleInitRef_t @0x20D8ED4 DW_TAG_structure_type @0x20D85B3 DW_TAG_pointer_type @0x20D8E9D DW_TAG_const_type @0x20D8EA3 DW_TAG_typedef J1939Tp_ConfigType @0x20D76C6 DW_TAG_structure_type J1939Tp_ConfigStructType @0x20D76E0

I tried to look at the source code and analyze it, but I couldn't find the problem.

DanielT commented 3 months ago

Hi,

A2ltool tries to extract the type information for every variable that needs to be updated. The source of this type information is the DWARF debug data located in the elf file. Theoretically, DWARF is a standard format, but in practice each compiler has its own quirks and produces slightly different output.

From the error messages we can see that the type reading code was unable to understand the information produced by your compiler in 4 different cases:

This is usually not a problem when you're updating the addresses, but you might have problems if you try to insert a variable of this type using --measurement, --characteristic, etc.

If you would like to help me fix this so that your compiler's output can be fully understood in the future, then I would need additional information from you. It would be ideal if you're able to produce a reduced .elf file that you can send to me. It should still trigger the problem but omits anything you consider to be company secrets / sensitive information / etc. Alternatively, you could dump the debug information to a text file using dwarfdump and send me that.

Monf1a commented 3 months ago

Hello, Daniel. Sorry for replying so late After I checked, I found that this error does not affect the functionality I need, it should be the ELF file problem. So I will close this issue. Thanks!