diff options
author | Alon Zakai <azakai@google.com> | 2020-01-23 14:11:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 14:11:15 -0800 |
commit | a74e9cd840e70cf6350b0c0d971a4316e7c3ee9e (patch) | |
tree | 869d78e48c3b3423b37afd8890a52c430745b492 /third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h | |
parent | d6d565505076581da85e2fc5044a697a8186abf9 (diff) | |
download | binaryen-a74e9cd840e70cf6350b0c0d971a4316e7c3ee9e.tar.gz binaryen-a74e9cd840e70cf6350b0c0d971a4316e7c3ee9e.tar.bz2 binaryen-a74e9cd840e70cf6350b0c0d971a4316e7c3ee9e.zip |
DWARF: Update .debug_loc (#2616)
Add support for that section to the YAML layer, and add
code to update it.
The updating is slightly tricky - unlike .debug_ranges, the
size of entries is not fixed. So we can't just skip entries,
as the end marker is smaller than a normal entry. Instead,
replace now-invalid segments with (1, 1) which is of size
0 and so should be ignored by the debugger (we can't use
(0, 0) as that would be an end marker, and (-1, *) is
the special base marker).
In the future we probably do want to do this in a more
sophisticated manner, completely rewriting the indexes
into the section as well. For now though this should be
enough for when binaryen does not optimize (as we
don't move/reorder anything).
Note that this doesn't update the location description
(like where on the wasm expression stack the value is).
Again, that is correct for when binaryen doesn't
optimize, but for fully optimized builds we would need
to track things (which would be hard!).
Also clean up some code that uses "Extra" instead of
"Delimiter" that was missed before, and shorten some
unnecessarily long names.
Diffstat (limited to 'third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h')
-rw-r--r-- | third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h b/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h index 943868b36..948418c7b 100644 --- a/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h +++ b/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h @@ -77,6 +77,12 @@ struct Range { uint64_t End; uint64_t SectionIndex; // XXX ? }; + +struct Loc { + uint32_t Start; + uint32_t End; + std::vector<uint8_t> Location; +}; // XXX BINARYEN --> struct PubEntry { @@ -154,6 +160,7 @@ struct Data { std::vector<StringRef> DebugStrings; std::vector<ARange> ARanges; std::vector<Range> Ranges; // XXX BINARYEN + std::vector<Loc> Locs; // XXX BINARYEN PubSection PubNames; PubSection PubTypes; @@ -175,6 +182,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARangeDescriptor) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARange) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Range) // XXX BINARYEN +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Loc) // XXX BINARYEN LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::PubEntry) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Unit) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::FormValue) @@ -210,6 +218,10 @@ template <> struct MappingTraits<DWARFYAML::Range> { // XXX BINARYEN static void mapping(IO &IO, DWARFYAML::Range &Range); }; +template <> struct MappingTraits<DWARFYAML::Loc> { // XXX BINARYEN + static void mapping(IO &IO, DWARFYAML::Loc &Loc); +}; + template <> struct MappingTraits<DWARFYAML::PubEntry> { static void mapping(IO &IO, DWARFYAML::PubEntry &Entry); }; |