Fix bracket parsing logic for objdump labels#50
Open
connorsimms wants to merge 6 commits into
Open
Conversation
…r-explorer/compiler-explorer#8809) Replaced character-by-character bracket tracking with a backward scan from end of line. Objdump formats label annotations with a leading space, so scanning backwards for ' <' safely handles template arguments, operator overloads, and inline assembly noise. Updated ce-bug-3963 snapshot since the previous parsing logic was incorrectly capturing '<char>' inside '<std::ctype<char>::_M_widen_init() const@plt>'. The new parser captures the full label and allows the shouldIgnoreFunction() filter to work.
…ating on symbols like 'operator< <T>'
Author
|
Update: I pushed an additional commit to harden the backwards-scan condition. I realized that scanning for |
Author
|
Actually, since |
partouf
reviewed
Jun 27, 2026
c52ab29 to
821e4d4
Compare
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.
Resolves compiler-explorer/compiler-explorer#8809
This PR fixes an issue where the asm parser fails to correctly highlight/filter functions containing nested or imbalanced brackets such as
call 410145 <void a<int, int>()>and
https://godbolt.org/z/3367rMndr.
The original logic used a forward-pass that overwrote the label start position at every
<and terminated at the first>or+. In certain cases with nested/imbalanced brackets (e.g.operator<<), the complete label is not captured.Instead of tracking label-state character-by-character, this version waits until the end of the instruction, finds the rightmost
>character, and then scans backwards for a<preceded by a space" <"(unless the<is the first character).This is safe because it is consistent with
objdumpformatting logic,GNU Binutils
objdump.c:Note on tests:
I added
ce-bug-8809.approved.txt. I also updatedce-bug-3963.approved.txt. The original parser was prematurely capturingcharin<std::ctype<char>::_M_widen_init() const@plt>and returningcharas the label. The new logic captures the entire name and allows the@pltfilter to work properly.