Repository navigation
Split dwarf.c into per-section files under format/dwarf ##bin - #26932
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
libr/bin/dwarf.chad grown to 5043 lines holding eleven unrelated parsers. This moves it tolibr/bin/format/dwarf/and splits it by section:git diff --color-moved=dimmed-zebrashows only moved blocks plus includes, a privatedwarf.hwith theREAD*macros, the section enum, two typedefs and sixteenR_IPI dwarf_*prototypes, and thestaticdrops those need. The five generically named helpers (get_section, ...) get thedwarf_prefix first so nothing generic leaves the file; the lib builds with-fvisibility=hidden, sonm -Doflibr_bin.sois unchanged.abbrev_findreplaces three identicalbsearchpairs in the CU loops, andget_section_bytesonly reads anElf_Chdrwhen the object is an ELF, instead of casting whateverbin_objis toELFOBJfor anyzdebug/SHF_COMPRESSEDsection (non-ELF compressed sections now return NULL, as the header check already made them).format/dwarf/deps.mkfollowsformat/pdb/deps.mk; meson lists the ten files.r_bin_dwarf_names andi/private.hdeclarations.id,CL,idx,tl,tandafvafteraaaare byte-identical to master on ten DWARF fixtures (2.4 M lines compared), and the load cost is unchanged. The newdb/formats/dwarfcase pins theSHF_COMPRESSEDpath on the.debugfixturedebuglinkalready uses (123228 rows); it fails when the decoder is skipped.