Skip to content

Conversation

ivg
Copy link
Member

@ivg ivg commented Nov 10, 2020

This PR fixes #1145 and makes disassembly printing more robust and
more in line with the disassembler implementation.

Background. When -dasm is specified we're iterating over sections
and print subroutines that belong to that sections. Since sections in
general can overlap we have duplicating outputs. This approach
followed the old implementation of the disassembler that indeed was
disassembling each section. However, at some point of time we switched
to the code-region abstraction. Code regions do no overlap and are
guaranteed to contain code. Now it is time to update the print plugin
and also iterate over code regions. We still use sections for names
but do not skip a region if there is no section (we just make up a
bogus name). That makes printing more resilent to various custom
loaders that might not provide sectioning information.

This PR fixes BinaryAnalysisPlatform#1145 and makes disassembly printing more robust and
more in line with the disassembler implementation.

Background. When `-dasm` is specified we're iterating over sections
and print subroutines that belong to that sections. Since sections in
general can overlap we have duplicating outputs. This approach
followed the old implementation of the disassembler that indeed was
disassembling each section. However, at some point of time we switched
to the code-region abstraction. Code regions do no overlap and are
guaranteed to contain code. Now it is time to update the print plugin
and also iterate over code regions. We still use sections for names
but do not skip a region if there is no section (we just make up a
bogus name). That makes printing more resilent to various custom
loaders that might not provide sectioning information.
@ivg ivg merged commit 9df2884 into BinaryAnalysisPlatform:master Nov 10, 2020
@ivg ivg deleted the fix-dasm branch December 1, 2021 19:14
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.

functions are doubling when DWARF information is available
1 participant