[SOL] [lldb] sbf / sbpf naming confusion #184
Open
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.
The problem
When receving the
target.xmlfrom a gdb-remote it typically contains the architecture name the remote represents. This name is later used for finding the correspondingCoreDefinitonso thatlldbwould be able to set up the target accordingly:llvm-project/lldb/source/Utility/ArchSpec.cpp
Line 1093 in e9617fb
SBFv0-v4's
CoreDefinitonsare given name strings starting withsbfv*. Yet when invoking theparseBPFArchfunction it's thesbpfv*names that are compared against the providedArchNamein the attempt to return the most appropriateTriple:llvm-project/llvm/lib/TargetParser/Triple.cpp
Line 421 in e9617fb
Unittests for v0-v4 triples are only written for the
sbpfv*cases:llvm-project/llvm/unittests/TargetParser/TripleTest.cpp
Line 773 in e9617fb
To make matters worse if remote's
target.xmlcontains, for example,<architecture>sbfv1</architecture>this later breakslldbwhen trying to get the output oftarget dump typesystem.What's changed
The aim of this patch is to prevent this confusion and align the names to using simply
sbpf*. Structures and enums aren't touched.