objutils 0.10.19__tar.gz → 0.10.20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. {objutils-0.10.19 → objutils-0.10.20}/.idea/objutils@1.iml +1 -1
  2. {objutils-0.10.19 → objutils-0.10.20}/.pre-commit-config.yaml +3 -3
  3. {objutils-0.10.19 → objutils-0.10.20}/PKG-INFO +2 -1
  4. {objutils-0.10.19 → objutils-0.10.20}/objutils/__init__.py +1 -1
  5. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/__init__.py +261 -198
  6. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/encoding.py +41 -27
  7. {objutils-0.10.19 → objutils-0.10.20}/objutils/elf/__init__.py +83 -65
  8. objutils-0.10.20/objutils/extensions/wrapper.cpp +152 -0
  9. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_elf_arm_attrs.py +15 -15
  10. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_elf_extract.py +13 -13
  11. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_elf_info.py +53 -53
  12. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_elf_syms.py +28 -28
  13. {objutils-0.10.19 → objutils-0.10.20}/objutils/utils/__init__.py +5 -1
  14. {objutils-0.10.19 → objutils-0.10.20}/objutils/version.py +1 -1
  15. {objutils-0.10.19 → objutils-0.10.20}/poetry.lock +135 -1
  16. {objutils-0.10.19 → objutils-0.10.20}/pyproject.toml +3 -2
  17. objutils-0.10.19/objutils/extensions/wrapper.cpp +0 -58
  18. {objutils-0.10.19 → objutils-0.10.20}/.clang-format +0 -0
  19. {objutils-0.10.19 → objutils-0.10.20}/.codacy.yml +0 -0
  20. {objutils-0.10.19 → objutils-0.10.20}/.codeclimate.yml +0 -0
  21. {objutils-0.10.19 → objutils-0.10.20}/.coveralls.yml +0 -0
  22. {objutils-0.10.19 → objutils-0.10.20}/.github/FUNDING.yml +0 -0
  23. {objutils-0.10.19 → objutils-0.10.20}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  24. {objutils-0.10.19 → objutils-0.10.20}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  25. {objutils-0.10.19 → objutils-0.10.20}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
  26. {objutils-0.10.19 → objutils-0.10.20}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  27. {objutils-0.10.19 → objutils-0.10.20}/.github/ISSUE_TEMPLATE.md +0 -0
  28. {objutils-0.10.19 → objutils-0.10.20}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  29. {objutils-0.10.19 → objutils-0.10.20}/.github/copilot-instructions.md +0 -0
  30. {objutils-0.10.19 → objutils-0.10.20}/.github/workflows/pythonapp.yml +0 -0
  31. {objutils-0.10.19 → objutils-0.10.20}/.gitignore +0 -0
  32. {objutils-0.10.19 → objutils-0.10.20}/.idea/.gitignore +0 -0
  33. {objutils-0.10.19 → objutils-0.10.20}/.idea/copilot.data.migration.ask2agent.xml +0 -0
  34. {objutils-0.10.19 → objutils-0.10.20}/.idea/deployment.xml +0 -0
  35. {objutils-0.10.19 → objutils-0.10.20}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  36. {objutils-0.10.19 → objutils-0.10.20}/.idea/misc.xml +0 -0
  37. {objutils-0.10.19 → objutils-0.10.20}/.idea/modules.xml +0 -0
  38. {objutils-0.10.19 → objutils-0.10.20}/.idea/pyLspTools.xml +0 -0
  39. {objutils-0.10.19 → objutils-0.10.20}/.idea/pyProjectModel.xml +0 -0
  40. {objutils-0.10.19 → objutils-0.10.20}/.idea/vcs.xml +0 -0
  41. {objutils-0.10.19 → objutils-0.10.20}/.pylintrc +0 -0
  42. {objutils-0.10.19 → objutils-0.10.20}/.readthedocs.yml +0 -0
  43. {objutils-0.10.19 → objutils-0.10.20}/.travis.yml +0 -0
  44. {objutils-0.10.19 → objutils-0.10.20}/CMakeLists.txt +0 -0
  45. {objutils-0.10.19 → objutils-0.10.20}/CODE_OF_CONDUCT.md +0 -0
  46. {objutils-0.10.19 → objutils-0.10.20}/CONTRIBUTORS +0 -0
  47. {objutils-0.10.19 → objutils-0.10.20}/LICENSE +0 -0
  48. {objutils-0.10.19 → objutils-0.10.20}/MANIFEST.in +0 -0
  49. {objutils-0.10.19 → objutils-0.10.20}/PULL_REQUEST_TEMPLATE.md +0 -0
  50. {objutils-0.10.19 → objutils-0.10.20}/appveyor.yml +0 -0
  51. {objutils-0.10.19 → objutils-0.10.20}/bandit.yml +0 -0
  52. {objutils-0.10.19 → objutils-0.10.20}/docs/Data_Formats.pdf +0 -0
  53. {objutils-0.10.19 → objutils-0.10.20}/docs/ELF_Format.pdf +0 -0
  54. {objutils-0.10.19 → objutils-0.10.20}/docs/KNOWN_GOOD_DWARF_REFERENCE.md +0 -0
  55. {objutils-0.10.19 → objutils-0.10.20}/docs/README.rst +0 -0
  56. {objutils-0.10.19 → objutils-0.10.20}/docs/apidoc.sh +0 -0
  57. {objutils-0.10.19 → objutils-0.10.20}/docs/conf.py +0 -0
  58. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.buildinfo +0 -0
  59. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.buildinfo.bak +0 -0
  60. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/README.doctree +0 -0
  61. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/environment.pickle +0 -0
  62. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/howto.doctree +0 -0
  63. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/index.doctree +0 -0
  64. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/installation.doctree +0 -0
  65. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/modules.doctree +0 -0
  66. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/objutils.doctree +0 -0
  67. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/objutils.elf.doctree +0 -0
  68. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/scripts.doctree +0 -0
  69. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/session.doctree +0 -0
  70. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/.doctrees/tutorial.doctree +0 -0
  71. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/README.html +0 -0
  72. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_images/objutils_basic.png +0 -0
  73. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/index.html +0 -0
  74. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/ash.html +0 -0
  75. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/binfile.html +0 -0
  76. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/checksums.html +0 -0
  77. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/cosmac.html +0 -0
  78. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/elf/defs.html +0 -0
  79. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/elf.html +0 -0
  80. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/emon52.html +0 -0
  81. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/etek.html +0 -0
  82. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/exceptions.html +0 -0
  83. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/fpc.html +0 -0
  84. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/hexdump.html +0 -0
  85. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/hexfile.html +0 -0
  86. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/ihex.html +0 -0
  87. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/image.html +0 -0
  88. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/logger.html +0 -0
  89. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/mostec.html +0 -0
  90. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/pickleif.html +0 -0
  91. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/rca.html +0 -0
  92. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/readers.html +0 -0
  93. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/registry.html +0 -0
  94. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/section.html +0 -0
  95. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/sig.html +0 -0
  96. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/srec.html +0 -0
  97. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/tek.html +0 -0
  98. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/titxt.html +0 -0
  99. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils/utils.html +0 -0
  100. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_modules/objutils.html +0 -0
  101. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/README.rst.txt +0 -0
  102. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/howto.rst.txt +0 -0
  103. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/index.rst.txt +0 -0
  104. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/installation.rst.txt +0 -0
  105. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/modules.rst.txt +0 -0
  106. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/objutils.elf.rst.txt +0 -0
  107. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/objutils.rst.txt +0 -0
  108. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/scripts.rst.txt +0 -0
  109. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/session.rst.txt +0 -0
  110. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_sources/tutorial.rst.txt +0 -0
  111. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/alabaster.css +0 -0
  112. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/basic.css +0 -0
  113. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/check-solid.svg +0 -0
  114. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/clipboard.min.js +0 -0
  115. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/copy-button.svg +0 -0
  116. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/copybutton.css +0 -0
  117. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/copybutton.js +0 -0
  118. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/copybutton_funcs.js +0 -0
  119. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/custom.css +0 -0
  120. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/doctools.js +0 -0
  121. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/documentation_options.js +0 -0
  122. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/file.png +0 -0
  123. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/github-banner.svg +0 -0
  124. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/language_data.js +0 -0
  125. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/minus.png +0 -0
  126. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/plus.png +0 -0
  127. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/pygments.css +0 -0
  128. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/scripts/bootstrap.js +0 -0
  129. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
  130. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/scripts/fontawesome.js +0 -0
  131. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/scripts/fontawesome.js.LICENSE.txt +0 -0
  132. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/scripts/pydata-sphinx-theme.js +0 -0
  133. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/searchtools.js +0 -0
  134. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/sphinx_highlight.js +0 -0
  135. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/styles/pydata-sphinx-theme.css +0 -0
  136. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/styles/theme.css +0 -0
  137. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  138. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  139. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  140. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  141. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  142. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  143. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/_static/webpack-macros.html +0 -0
  144. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/genindex.html +0 -0
  145. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/howto.html +0 -0
  146. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/index.html +0 -0
  147. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/installation.html +0 -0
  148. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/modules.html +0 -0
  149. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/objects.inv +0 -0
  150. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/objutils.elf.html +0 -0
  151. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/objutils.html +0 -0
  152. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/py-modindex.html +0 -0
  153. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/scripts.html +0 -0
  154. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/search.html +0 -0
  155. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/searchindex.js +0 -0
  156. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/session.html +0 -0
  157. {objutils-0.10.19 → objutils-0.10.20}/docs/docs/_build/html/tutorial.html +0 -0
  158. {objutils-0.10.19 → objutils-0.10.20}/docs/elf-64-gen.pdf +0 -0
  159. {objutils-0.10.19 → objutils-0.10.20}/docs/example0.srec +0 -0
  160. {objutils-0.10.19 → objutils-0.10.20}/docs/howto.rst +0 -0
  161. {objutils-0.10.19 → objutils-0.10.20}/docs/index.rst +0 -0
  162. {objutils-0.10.19 → objutils-0.10.20}/docs/installation.rst +0 -0
  163. {objutils-0.10.19 → objutils-0.10.20}/docs/make.bat +0 -0
  164. {objutils-0.10.19 → objutils-0.10.20}/docs/modules.rst +0 -0
  165. {objutils-0.10.19 → objutils-0.10.20}/docs/objutils.elf.rst +0 -0
  166. {objutils-0.10.19 → objutils-0.10.20}/docs/objutils.rst +0 -0
  167. {objutils-0.10.19 → objutils-0.10.20}/docs/objutils_banner.png +0 -0
  168. {objutils-0.10.19 → objutils-0.10.20}/docs/objutils_basic.png +0 -0
  169. {objutils-0.10.19 → objutils-0.10.20}/docs/objutils_dark.jpg +0 -0
  170. {objutils-0.10.19 → objutils-0.10.20}/docs/objutils_social.jpg +0 -0
  171. {objutils-0.10.19 → objutils-0.10.20}/docs/requirements.txt +0 -0
  172. {objutils-0.10.19 → objutils-0.10.20}/docs/scripts.rst +0 -0
  173. {objutils-0.10.19 → objutils-0.10.20}/docs/session.rst +0 -0
  174. {objutils-0.10.19 → objutils-0.10.20}/docs/tutorial.rst +0 -0
  175. {objutils-0.10.19 → objutils-0.10.20}/docs/tutorial1.ipynb +0 -0
  176. {objutils-0.10.19 → objutils-0.10.20}/objutils/.coveragerc +0 -0
  177. {objutils-0.10.19 → objutils-0.10.20}/objutils/.vscode/launch.json +0 -0
  178. {objutils-0.10.19 → objutils-0.10.20}/objutils/.vscode/settings.json +0 -0
  179. {objutils-0.10.19 → objutils-0.10.20}/objutils/a2l_test.shf +0 -0
  180. {objutils-0.10.19 → objutils-0.10.20}/objutils/ash.py +0 -0
  181. {objutils-0.10.19 → objutils-0.10.20}/objutils/binfile.py +0 -0
  182. {objutils-0.10.19 → objutils-0.10.20}/objutils/checksums.py +0 -0
  183. {objutils-0.10.19 → objutils-0.10.20}/objutils/cosmac.py +0 -0
  184. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/attrparser.py +0 -0
  185. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/c_generator.py +0 -0
  186. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/constants.py +0 -0
  187. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/lineprog.py +0 -0
  188. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/readers.py +0 -0
  189. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/sm.py +0 -0
  190. {objutils-0.10.19 → objutils-0.10.20}/objutils/dwarf/traverser.py +0 -0
  191. {objutils-0.10.19 → objutils-0.10.20}/objutils/elf/arm/__init__.py +0 -0
  192. {objutils-0.10.19 → objutils-0.10.20}/objutils/elf/arm/attributes.py +0 -0
  193. {objutils-0.10.19 → objutils-0.10.20}/objutils/elf/defs.py +0 -0
  194. {objutils-0.10.19 → objutils-0.10.20}/objutils/elf/model.py +0 -0
  195. {objutils-0.10.19 → objutils-0.10.20}/objutils/emon52.py +0 -0
  196. {objutils-0.10.19 → objutils-0.10.20}/objutils/etek.py +0 -0
  197. {objutils-0.10.19 → objutils-0.10.20}/objutils/exceptions.py +0 -0
  198. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/__init__.py +0 -0
  199. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/ctre.hpp +0 -0
  200. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/difflib.h +0 -0
  201. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/elf_parser.cpp +0 -0
  202. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/elf_parser.hpp +0 -0
  203. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/exceptions.cpp +0 -0
  204. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/exceptions.hpp +0 -0
  205. {objutils-0.10.19 → objutils-0.10.20}/objutils/extensions/hexfile.cpp +0 -0
  206. {objutils-0.10.19 → objutils-0.10.20}/objutils/fpc.py +0 -0
  207. {objutils-0.10.19 → objutils-0.10.20}/objutils/hexdump.py +0 -0
  208. {objutils-0.10.19 → objutils-0.10.20}/objutils/hexfile.py +0 -0
  209. {objutils-0.10.19 → objutils-0.10.20}/objutils/ieee695.py +0 -0
  210. {objutils-0.10.19 → objutils-0.10.20}/objutils/ihex.py +0 -0
  211. {objutils-0.10.19 → objutils-0.10.20}/objutils/image.py +0 -0
  212. {objutils-0.10.19 → objutils-0.10.20}/objutils/logger.py +0 -0
  213. {objutils-0.10.19 → objutils-0.10.20}/objutils/mostec.py +0 -0
  214. {objutils-0.10.19 → objutils-0.10.20}/objutils/objutils.code-workspace +0 -0
  215. {objutils-0.10.19 → objutils-0.10.20}/objutils/oocdtxt.py +0 -0
  216. {objutils-0.10.19 → objutils-0.10.20}/objutils/pecoff/__init__.py +0 -0
  217. {objutils-0.10.19 → objutils-0.10.20}/objutils/pecoff/defs.py +0 -0
  218. {objutils-0.10.19 → objutils-0.10.20}/objutils/pecoff/model.py +0 -0
  219. {objutils-0.10.19 → objutils-0.10.20}/objutils/pecoff/pdb/__init__.py +0 -0
  220. {objutils-0.10.19 → objutils-0.10.20}/objutils/pickleif.py +0 -0
  221. {objutils-0.10.19 → objutils-0.10.20}/objutils/rca.py +0 -0
  222. {objutils-0.10.19 → objutils-0.10.20}/objutils/readers.py +0 -0
  223. {objutils-0.10.19 → objutils-0.10.20}/objutils/registry.py +0 -0
  224. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/arduino_build_artifacts.py +0 -0
  225. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_cgen.py +0 -0
  226. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_coff_extract.py +0 -0
  227. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_coff_import.py +0 -0
  228. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_coff_info.py +0 -0
  229. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_coff_syms.py +0 -0
  230. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_dwarf_import.py +0 -0
  231. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_dwarf_info.py +0 -0
  232. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_elf_import.py +0 -0
  233. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_hex_info.py +0 -0
  234. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_hex_merge.py +0 -0
  235. {objutils-0.10.19 → objutils-0.10.20}/objutils/scripts/oj_hex_split.py +0 -0
  236. {objutils-0.10.19 → objutils-0.10.20}/objutils/section.py +0 -0
  237. {objutils-0.10.19 → objutils-0.10.20}/objutils/shf.py +0 -0
  238. {objutils-0.10.19 → objutils-0.10.20}/objutils/sig.py +0 -0
  239. {objutils-0.10.19 → objutils-0.10.20}/objutils/srec.py +0 -0
  240. {objutils-0.10.19 → objutils-0.10.20}/objutils/symbols.py +0 -0
  241. {objutils-0.10.19 → objutils-0.10.20}/objutils/tek.py +0 -0
  242. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/__init__.py +0 -0
  243. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_arm_attributes.py +0 -0
  244. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_asam_alternate_modes.py +0 -0
  245. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_ash.py +0 -0
  246. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_c_generator.py +0 -0
  247. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_checksums.py +0 -0
  248. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_cygpath.py +0 -0
  249. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_diff_bin.py +0 -0
  250. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_elf.py +0 -0
  251. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_emon52.py +0 -0
  252. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_etek.py +0 -0
  253. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_examples_cgen.py +0 -0
  254. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_extended.py +0 -0
  255. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_fpc.py +0 -0
  256. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_hexdump.py +0 -0
  257. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_hexfile.py +0 -0
  258. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_ihex.py +0 -0
  259. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_image.py +0 -0
  260. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_mostec.py +0 -0
  261. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_oocdtxt.py +0 -0
  262. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_pdb_typeinfo_dump.py +0 -0
  263. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_probe_uniqueness.py +0 -0
  264. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_readers.py +0 -0
  265. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_registry.py +0 -0
  266. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_repr.py +0 -0
  267. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_section.py +0 -0
  268. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_section_join.py +0 -0
  269. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_shf.py +0 -0
  270. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_sm.py +0 -0
  271. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_srec.py +0 -0
  272. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_tek.py +0 -0
  273. {objutils-0.10.19 → objutils-0.10.20}/objutils/tests/test_titext.py +0 -0
  274. {objutils-0.10.19 → objutils-0.10.20}/objutils/titxt.py +0 -0
  275. {objutils-0.10.19 → objutils-0.10.20}/objutils/utils/arduino.py +0 -0
  276. {objutils-0.10.19 → objutils-0.10.20}/objutils/utils/diff.py +0 -0
  277. {objutils-0.10.19 → objutils-0.10.20}/requirements.txt +0 -0
  278. {objutils-0.10.19 → objutils-0.10.20}/setup.cfg +0 -0
  279. {objutils-0.10.19 → objutils-0.10.20}/setup.py +0 -0
  280. {objutils-0.10.19 → objutils-0.10.20}/test_join_sections.py +0 -0
  281. {objutils-0.10.19 → objutils-0.10.20}/test_requirements.txt +0 -0
@@ -8,4 +8,4 @@
8
8
  <orderEntry type="jdk" jdkName="Poetry (objutils) (2)" jdkType="Python SDK" />
9
9
  <orderEntry type="sourceFolder" forTests="false" />
10
10
  </component>
11
- </module>
11
+ </module>
@@ -35,21 +35,21 @@ repos:
35
35
  - id: trailing-whitespace
36
36
 
37
37
  - repo: https://github.com/psf/black-pre-commit-mirror
38
- rev: 26.5.1
38
+ rev: 26.10.1
39
39
  hooks:
40
40
  - id: black
41
41
  language_version: python3.13
42
42
  args: ["--line-length=132"]
43
43
 
44
44
  - repo: https://github.com/astral-sh/ruff-pre-commit
45
- rev: v0.16.6
45
+ rev: v0.17.0
46
46
  hooks:
47
47
  - id: ruff
48
48
  args: ["--fix", "--exit-non-zero-on-fix"]
49
49
 
50
50
 
51
51
  - repo: https://github.com/asottile/pyupgrade
52
- rev: v3.21.2
52
+ rev: v3.22.0
53
53
  hooks:
54
54
  - id: pyupgrade
55
55
  args: ["--py39-plus"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: objutils
3
- Version: 0.10.19
3
+ Version: 0.10.20
4
4
  Summary: Objectfile library for Python
5
5
  Keywords: hex files,intel hex,s19,srec,srecords,object files,map files,embedded,microcontroller,ECU,shf,rfc4194
6
6
  Author-Email: Christoph Schueler <cpu12.gems@googlemail.com>
@@ -24,6 +24,7 @@ Requires-Dist: sqlalchemy>=2.0.29
24
24
  Requires-Dist: rich>=14.2
25
25
  Requires-Dist: numpy>=2.2.5
26
26
  Requires-Dist: ufilename<0.2.0,>=0.1.1
27
+ Requires-Dist: coverage<8.0.0,>=7.16.2
27
28
  Provides-Extra: dev
28
29
  Requires-Dist: bumpver>=2023.1129; extra == "dev"
29
30
  Requires-Dist: pre-commit>=3.7.0; extra == "dev"
@@ -13,7 +13,7 @@ Registers CODECS and implements an interface to them.
13
13
  The first parameter is always the codec name.
14
14
  """
15
15
 
16
- __version__ = "0.10.19"
16
+ __version__ = "0.10.20"
17
17
 
18
18
  __all__ = [
19
19
  "Image",
@@ -186,7 +186,7 @@ import io
186
186
  import json
187
187
  from collections import OrderedDict
188
188
  from dataclasses import dataclass, field
189
- from typing import Any, Optional
189
+ from typing import Any
190
190
 
191
191
  from construct import (
192
192
  Array,
@@ -198,8 +198,6 @@ from construct import (
198
198
  If,
199
199
  IfThenElse,
200
200
  Int8ul,
201
- Int32ub,
202
- Int32ul,
203
201
  Padding,
204
202
  Pass,
205
203
  Struct,
@@ -433,6 +431,10 @@ class Abbrevations:
433
431
  "stop" / Tell,
434
432
  )
435
433
 
434
+ @staticmethod
435
+ def _tag_name_fallback(tag: int) -> str:
436
+ return f"User TAG value: 0x{tag:04x}"
437
+
436
438
  def __init__(self, section):
437
439
  """Initialize abbreviation parser.
438
440
 
@@ -442,6 +444,67 @@ class Abbrevations:
442
444
  self.image = section.image
443
445
  self.length = len(section.image)
444
446
  self.abbrevations = {}
447
+ self._parsed_offsets: set[int] = set()
448
+ self._tag_name_cache: dict[int, str] = {}
449
+ self._encoding_cache: dict[int, Any] = {}
450
+ self._form_cache: dict[int, Any] = {}
451
+
452
+ def _tag_name(self, tag: int) -> str:
453
+ cached = self._tag_name_cache.get(tag)
454
+ if cached is not None:
455
+ return cached
456
+ try:
457
+ value = constants.Tag(tag).name
458
+ except (AttributeError, TypeError, ValueError):
459
+ value = self._tag_name_fallback(tag)
460
+ self._tag_name_cache[tag] = value
461
+ return value
462
+
463
+ def _encoding(self, attr_value: int):
464
+ cached = self._encoding_cache.get(attr_value)
465
+ if cached is not None:
466
+ return cached
467
+ try:
468
+ value = constants.AttributeEncoding(attr_value)
469
+ except (TypeError, ValueError):
470
+ value = constants.FakeEncoding(attr_value)
471
+ self._encoding_cache[attr_value] = value
472
+ return value
473
+
474
+ def _form(self, form_value: int):
475
+ cached = self._form_cache.get(form_value)
476
+ if cached is not None:
477
+ return cached
478
+ value = constants.AttributeForm(form_value)
479
+ self._form_cache[form_value] = value
480
+ return value
481
+
482
+ def _build_abbrev(self, tag: int, children: bool, attrs: list[Any]) -> Abbrevation:
483
+ abbrev = Abbrevation(self._tag_name(tag), bool(children), [])
484
+ append_attr = abbrev.attrs.append
485
+ implicit_const = constants.AttributeForm.DW_FORM_implicit_const
486
+ for attr_value, form_value, special_value in attrs:
487
+ encoding = self._encoding(attr_value)
488
+ form = self._form(form_value)
489
+ if form == implicit_const:
490
+ append_attr(Attribute(encoding, form, special_value))
491
+ else:
492
+ append_attr(Attribute(encoding, form))
493
+ return abbrev
494
+
495
+ def _read_uleb(self, image: bytes, offset: int) -> tuple[int, int]:
496
+ """Decode one ULEB128 value from image[offset:] and return (value, new_offset)."""
497
+ result = 0
498
+ shift = 0
499
+ length = self.length
500
+ while offset < length:
501
+ bval = image[offset]
502
+ offset += 1
503
+ result |= (bval & 0x7F) << shift
504
+ if (bval & 0x80) == 0:
505
+ return result, offset
506
+ shift += 7
507
+ raise ValueError("Truncated ULEB128 in .debug_abbrev section.")
445
508
 
446
509
  def get(self, abbr_offset, item):
447
510
  """Retrieve abbreviation schema by code.
@@ -455,96 +518,53 @@ class Abbrevations:
455
518
  """
456
519
  if item == 0:
457
520
  return None
458
- if (abbr_offset, item) in self.abbrevations:
459
- return self.abbrevations.get(
460
- (
461
- abbr_offset,
462
- item,
463
- )
464
- )
465
- else:
466
- return self._fetch(abbr_offset, item)
521
+ if abbr_offset not in self._parsed_offsets:
522
+ self._fetch(abbr_offset)
523
+ return self.abbrevations.get((abbr_offset, item))
467
524
 
468
- def _fetch(self, abbr_offset, item):
525
+ def _fetch(self, abbr_offset):
469
526
  """Parse abbreviation from raw bytes and cache it.
470
527
 
471
- Parses abbreviation table starting at abbr_offset, caching all
472
- entries encountered until the requested item is found.
528
+ Parses a complete abbreviation table starting at abbr_offset and
529
+ caches all entries for O(1) subsequent lookups.
473
530
 
474
531
  Args:
475
532
  abbr_offset: Start offset in abbreviation section
476
- item: Target abbreviation code
477
-
478
- Returns:
479
- Abbrevation instance for the requested code
480
533
  """
534
+ if abbr_offset in self._parsed_offsets:
535
+ return
536
+
537
+ image = self.image
481
538
  offset = abbr_offset
482
- while True:
483
- abbrv_header = self.AbbrevationHeader.parse(self.image[offset:])
484
- # print("ABBREV-CODE", hex(offset), abbrv_header)
485
- code = abbrv_header.code
486
- offset += abbrv_header.stop - abbrv_header.start
487
- if code == 0:
488
- continue
489
- key = (
490
- abbr_offset,
491
- code,
492
- )
493
- if offset >= self.length:
494
- break
495
- abbrv_body = self.AbbrevationBody.parse(self.image[offset:])
496
- tag = abbrv_body.tag
497
- children = abbrv_body.children
498
- offset += abbrv_body.stop - abbrv_body.start
539
+ try:
540
+ while offset < self.length:
541
+ code, offset = self._read_uleb(image, offset)
542
+ if code == 0:
543
+ break
544
+ tag, offset = self._read_uleb(image, offset)
545
+ if offset >= self.length:
546
+ break
547
+ children = image[offset]
548
+ offset += 1
499
549
 
500
- try:
501
- self.abbrevations[key] = Abbrevation(
502
- constants.Tag(tag).name,
503
- (children == 1),
504
- [],
505
- )
506
- except TypeError:
507
- self.abbrevations[key] = Abbrevation(
508
- f"User TAG value: 0x{tag:04x}",
509
- (children == 1),
510
- [],
511
- )
550
+ attrs: list[tuple[int, int, Any]] = []
551
+ while True:
552
+ attr_value, offset = self._read_uleb(image, offset)
553
+ form_value, offset = self._read_uleb(image, offset)
554
+ if attr_value == 0 or form_value == 0:
555
+ break
556
+ if form_value == constants.AttributeForm.DW_FORM_implicit_const:
557
+ special_value, offset = self._read_uleb(image, offset)
558
+ attrs.append((attr_value, form_value, special_value))
559
+ else:
560
+ attrs.append((attr_value, form_value, None))
512
561
 
513
- while True:
514
- attr = self.AttributeStruct.parse(self.image[offset:])
515
- if not attr.next:
516
- # key_offset = offset
517
- break
518
- if attr.formValue == constants.AttributeForm.DW_FORM_implicit_const:
519
- offset += attr.stop - attr.start
520
- special_value = self.SpecialValueStruct.parse(self.image[offset:])
521
- offset += special_value.stop - special_value.start
522
- self.abbrevations[key].attrs.append(
523
- Attribute(
524
- constants.AttributeEncoding(attr.attrValue),
525
- constants.AttributeForm(attr.formValue),
526
- special_value.value,
527
- )
528
- )
529
- continue
530
- if attr.attrValue != 0 and attr.formValue != 0:
531
- try:
532
- self.abbrevations[key].attrs.append(
533
- Attribute(
534
- constants.AttributeEncoding(attr.attrValue),
535
- constants.AttributeForm(attr.formValue),
536
- )
537
- )
538
- except TypeError:
539
- self.abbrevations[key].attrs.append(
540
- Attribute(
541
- constants.FakeEncoding(attr.attrValue),
542
- constants.AttributeForm(attr.formValue),
543
- )
544
- )
545
- offset += attr.stop - attr.start
546
- if code == item:
547
- return self.abbrevations[key]
562
+ self.abbrevations[(abbr_offset, code)] = self._build_abbrev(tag, (children == 1), attrs)
563
+ except ValueError:
564
+ # Graceful fallback: keep already cached entries and mark offset parsed.
565
+ pass
566
+
567
+ self._parsed_offsets.add(abbr_offset)
548
568
 
549
569
 
550
570
  class DwarfProcessor:
@@ -619,9 +639,6 @@ class DwarfProcessor:
619
639
  Earlier or later DWARF versions may not parse correctly.
620
640
  """
621
641
 
622
- DATATYPES32 = {
623
- "Addr": (Int32ul, Int32ub), # 4 - Unsigned program address
624
- }
625
642
 
626
643
  UTF8String = CString(encoding="utf8")
627
644
 
@@ -672,6 +689,7 @@ class DwarfProcessor:
672
689
  strings=self.strings,
673
690
  line_strings=self.line_strings,
674
691
  )
692
+ self.elf_address_size = address_size
675
693
  self.readers = factory.readers
676
694
  self.stack_machine = factory.stack_machine
677
695
 
@@ -1030,135 +1048,180 @@ class DwarfProcessor:
1030
1048
  "stop" / Tell,
1031
1049
  "size" / Computed(this.stop - this.start),
1032
1050
  )
1051
+ from contextlib import nullcontext
1052
+
1053
+ from sqlalchemy import func
1054
+
1033
1055
  offset = 0
1034
1056
  result = []
1035
1057
  die_map = {}
1036
1058
  idx = 0
1059
+ pending_die_rows: list[dict[str, Any]] = []
1060
+ pending_attr_rows: list[dict[str, Any]] = []
1037
1061
  session = self.db_session
1038
1062
  try:
1039
1063
  no_autoflush = session.no_autoflush
1040
1064
  except AttributeError:
1041
- from contextlib import nullcontext
1042
-
1043
1065
  no_autoflush = nullcontext()
1044
1066
 
1045
- with no_autoflush:
1046
- while True:
1047
- section_pos = image.tell()
1048
- if section_pos >= section_length - 1:
1049
- break
1050
- root_element = DebugInformationEntry("root")
1051
- die_stack = [root_element]
1052
- db_die_stack = []
1053
- pending_dies = []
1054
- pending_attrs = []
1055
-
1056
- dbgInfo = DbgInfo.parse_stream(image) # CU
1057
- cu_length = dbgInfo.header.unit_length
1058
- version = dbgInfo.header.version
1059
- if version < 5:
1060
- debug_abbrev_offset = dbgInfo.body.debug_abbrev_offset
1061
- address_size = dbgInfo.body.address_size
1062
- else:
1063
- debug_abbrev_offset = dbgInfo.body.debug_abbrev_offset
1064
- address_size = dbgInfo.body.address_size
1065
- idx += 1
1066
- if self.verbose:
1067
- print(
1068
- f" Compilation Unit #{idx:05d} offset: 0x{dbgInfo.start:08x} length: 0x{cu_length:08x} abbrev-offset: 0x{debug_abbrev_offset:08x} pointer-size: {address_size} version: {version}"
1069
- )
1070
- level = 0
1071
- pos = 0
1072
- offset += dbgInfo.stop - dbgInfo.start
1073
- form_readers = self.get_form_readers(address_size)
1074
- if pos >= cu_length:
1075
- break
1067
+ max_rid = session.query(func.max(model.DebugInformationEntry.rid)).scalar() or 0
1068
+ next_die_rid = int(max_rid) + 1
1069
+
1070
+ # Chunk sizes tuned for SQLite bulk inserts to avoid oversized execute payloads.
1071
+ DIE_BATCH_SIZE = 10000
1072
+ ATTR_BATCH_SIZE = 20000
1073
+
1074
+ def _iter_chunks(rows: list[dict[str, Any]], size: int):
1075
+ for start_idx in range(0, len(rows), size):
1076
+ yield rows[start_idx : start_idx + size]
1077
+
1078
+ def _coerce_tag_value(tag: Any) -> Any:
1079
+ try:
1080
+ return int(constants.Tag[str(tag)])
1081
+ except (KeyError, TypeError, ValueError):
1082
+ try:
1083
+ return int(tag)
1084
+ except (TypeError, ValueError):
1085
+ return tag
1086
+
1087
+ SQLITE_INT64_MIN = -(2**63)
1088
+ SQLITE_INT64_MAX = 2**63 - 1
1089
+
1090
+ def _normalize_raw_value(value: Any) -> Any:
1091
+ """Keep DB writes SQLite-safe while preserving semantics for consumers."""
1092
+ if value is None:
1093
+ return None
1094
+ if isinstance(value, int) and not (SQLITE_INT64_MIN <= value <= SQLITE_INT64_MAX):
1095
+ return str(value)
1096
+ return value
1097
+
1098
+ try:
1099
+ with no_autoflush:
1076
1100
  while True:
1077
- die_start = None
1078
- start = image.tell()
1079
- if start >= dbgInfo.start + cu_length + 4:
1101
+ section_pos = image.tell()
1102
+ if section_pos >= section_length - 1:
1080
1103
  break
1081
- if start >= section_length - 1:
1082
- break
1083
- attr = Attribute.parse_stream(image)
1084
- abbr = self.abbrevations.get(debug_abbrev_offset, attr.attr)
1085
- if not abbr:
1086
- # End of a sibling list: pop one level on both in-memory and DB stacks
1087
- if level > 0:
1088
- level -= 1
1089
- # Pop in-memory DIE stack if we have a nested context (keep root at index 0)
1090
- if len(die_stack) > 1:
1091
- die_stack.pop()
1092
- # Pop DB parent stack so subsequent siblings attach to the correct parent
1093
- if db_die_stack:
1094
- db_die_stack.pop()
1104
+ root_element = DebugInformationEntry("root")
1105
+ die_stack = [root_element]
1106
+ db_parent_stack: list[int] = []
1107
+
1108
+ dbgInfo = DbgInfo.parse_stream(image) # CU
1109
+ cu_length = dbgInfo.header.unit_length
1110
+ version = dbgInfo.header.version
1111
+ if version < 5:
1112
+ debug_abbrev_offset = dbgInfo.body.debug_abbrev_offset
1113
+ address_size = dbgInfo.body.address_size
1095
1114
  else:
1096
- die = DebugInformationEntry(abbr.tag)
1097
- db_die = model.DebugInformationEntry(tag=abbr.tag)
1098
- # Cache-friendly: store DIE offset for quick lookups by external tools
1099
- db_die.offset = start
1100
- # Store CU start for reference resolution later
1101
- db_die.cu_start = dbgInfo.start
1102
- # Set parent on DB DIE if we have one on stack
1103
- if db_die_stack:
1104
- db_die.parent = db_die_stack[-1]
1105
- pending_dies.append(db_die)
1106
- if attr.attr != 0:
1107
- die_stack[-1].children.append(die)
1108
- die_start = start
1109
- if abbr.children:
1110
- die_stack.append(die)
1111
- # Push this db_die as the current parent for subsequent entries until a null DIE is encountered
1112
- db_die_stack.append(db_die)
1113
- level += 1
1114
- for enc, form, special_value in abbr.attrs:
1115
- reader = form_readers.get(form)
1116
- start = image.tell()
1117
- if reader is None:
1118
- if form == constants.AttributeForm.DW_FORM_implicit_const:
1119
- value = special_value
1120
- # In-memory representation (keep minimal to preserve structure)
1121
- die.attributes.append((enc.name, DIEAttribute(value, value)))
1122
- pending_attrs.append((db_die, enc, form, value))
1123
- offset += attr.stop - attr.start
1124
- pos = image.tell()
1125
- if pos >= dbgInfo.start + cu_length + 4:
1126
- break
1127
- continue
1128
- else:
1129
- # Unknown reader; skip gracefully
1130
- continue
1131
- value = reader.parse_stream(image)
1132
- # In-memory representation: do not compute heavy display, keep simple
1133
- die.attributes.append((enc.name, DIEAttribute(value, value)))
1134
- # DB attribute: store for lazy display
1135
- pending_attrs.append((db_die, enc, form, value))
1136
- offset += attr.stop - attr.start
1137
- pos = image.tell()
1138
- if pos >= dbgInfo.start + cu_length + 4:
1115
+ if version > 5: # Handle messed up version numbers in some binaries (e.g. 39424)
1116
+ address_size = self.elf_address_size
1117
+ else:
1118
+ address_size = dbgInfo.body.address_size
1119
+ debug_abbrev_offset = dbgInfo.body.debug_abbrev_offset
1120
+ idx += 1
1121
+ if self.verbose:
1122
+ print(
1123
+ f" Compilation Unit #{idx:05d} offset: 0x{dbgInfo.start:08x} length: 0x{cu_length:08x} abbrev-offset: 0x{debug_abbrev_offset:08x}"
1124
+ )
1125
+ level = 0
1126
+ pos = 0
1127
+ offset += dbgInfo.stop - dbgInfo.start
1128
+ form_readers = self.get_form_readers(address_size)
1129
+ if pos >= cu_length:
1130
+ break
1131
+ while True:
1132
+ die_start = None
1133
+ start = image.tell()
1134
+ if start >= dbgInfo.start + cu_length + 4:
1139
1135
  break
1140
- if die_start is not None:
1141
- die_map[die_start] = die
1142
-
1143
- if pending_dies:
1144
- session.add_all(pending_dies)
1145
- session.flush()
1146
- if pending_attrs:
1147
- attr_rows = []
1148
- for db_die, enc, form, value in pending_attrs:
1149
- attr_rows.append(
1136
+ if start >= section_length - 1:
1137
+ break
1138
+ attr = Attribute.parse_stream(image)
1139
+ abbr = self.abbrevations.get(debug_abbrev_offset, attr.attr)
1140
+ if not abbr:
1141
+ if level > 0:
1142
+ level -= 1
1143
+ if len(die_stack) > 1:
1144
+ die_stack.pop()
1145
+ if db_parent_stack:
1146
+ db_parent_stack.pop()
1147
+ else:
1148
+ die = DebugInformationEntry(abbr.tag)
1149
+ die_rid = next_die_rid
1150
+ next_die_rid += 1
1151
+ parent_rid = db_parent_stack[-1] if db_parent_stack else None
1152
+
1153
+ pending_die_rows.append(
1150
1154
  {
1151
- "name": int(enc),
1152
- "form": int(form) if form is not None else None,
1153
- "raw_value": value,
1154
- "entry_id": db_die.rid,
1155
+ "rid": die_rid,
1156
+ "tag": _coerce_tag_value(abbr.tag),
1157
+ "offset": start,
1158
+ "cu_start": dbgInfo.start,
1159
+ "parent_id": parent_rid,
1155
1160
  }
1156
1161
  )
1157
- if attr_rows:
1158
- session.execute(model.DIEAttribute.__table__.insert(), attr_rows)
1159
- session.flush()
1160
- result.append(root_element)
1161
- session.commit()
1162
+
1163
+ if attr.attr != 0:
1164
+ die_stack[-1].children.append(die)
1165
+ die_start = start
1166
+ if abbr.children:
1167
+ die_stack.append(die)
1168
+ db_parent_stack.append(die_rid)
1169
+ level += 1
1170
+ for enc, form, special_value in abbr.attrs:
1171
+ reader = form_readers.get(form)
1172
+ start = image.tell()
1173
+ if reader is None:
1174
+ if form == constants.AttributeForm.DW_FORM_implicit_const:
1175
+ value = special_value
1176
+ normalized_value = _normalize_raw_value(value)
1177
+ die.attributes.append((enc.name, DIEAttribute(normalized_value, normalized_value)))
1178
+ pending_attr_rows.append(
1179
+ {
1180
+ "name": int(enc),
1181
+ "form": int(form),
1182
+ "raw_value": normalized_value,
1183
+ "entry_id": die_rid,
1184
+ }
1185
+ )
1186
+ offset += attr.stop - attr.start
1187
+ pos = image.tell()
1188
+ if pos >= dbgInfo.start + cu_length + 4:
1189
+ break
1190
+ continue
1191
+ else:
1192
+ continue
1193
+ value = reader.parse_stream(image)
1194
+ normalized_value = _normalize_raw_value(value)
1195
+ die.attributes.append((enc.name, DIEAttribute(normalized_value, normalized_value)))
1196
+ pending_attr_rows.append(
1197
+ {
1198
+ "name": int(enc),
1199
+ "form": int(form) if form is not None else None,
1200
+ "raw_value": normalized_value,
1201
+ "entry_id": die_rid,
1202
+ }
1203
+ )
1204
+ offset += attr.stop - attr.start
1205
+ pos = image.tell()
1206
+ if pos >= dbgInfo.start + cu_length + 4:
1207
+ break
1208
+ if die_start is not None:
1209
+ die_map[die_start] = die
1210
+
1211
+ result.append(root_element)
1212
+
1213
+ if pending_die_rows:
1214
+ die_insert = model.DebugInformationEntry.__table__.insert()
1215
+ for chunk in _iter_chunks(pending_die_rows, DIE_BATCH_SIZE):
1216
+ session.execute(die_insert, chunk)
1217
+ if pending_attr_rows:
1218
+ attr_insert = model.DIEAttribute.__table__.insert()
1219
+ for chunk in _iter_chunks(pending_attr_rows, ATTR_BATCH_SIZE):
1220
+ session.execute(attr_insert, chunk)
1221
+ session.commit()
1222
+ except Exception:
1223
+ session.rollback()
1224
+ raise
1162
1225
  return DebugInformation(die_map, [d.children[0] for d in result])
1163
1226
 
1164
1227
  def pubnames(self):