summaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
authorAlex Langford <alangford@apple.com>2023-05-09 12:51:10 -0700
committerAlex Langford <alangford@apple.com>2023-05-09 13:46:27 -0700
commitb77e41f2886aca278b41a85fc0f947e078b3da13 (patch)
tree4035cb3a3ad11c18fc430d00fcf22de81fd43ae3 /lldb
parent9a7b363eeb867974aeb511c6ce0cfad723523aed (diff)
downloadllvm-b77e41f2886aca278b41a85fc0f947e078b3da13.tar.gz
[lldb][NFCI] Remove custom dwarf LEB128 types
The LEB128 type defined by the DWARF standard is explicitly a variable-length encoding of an integer. LLDB had defined `uleb128` and `sleb128` types to be 32-bit but in many places in both LLVM and LLDB we treat the maximum width of LEB128 types to be 64, so let's remove these types and be consistent. Differential Revision: https://reviews.llvm.org/D150222
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Core/dwarf.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp5
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp8
5 files changed, 10 insertions, 13 deletions
diff --git a/lldb/include/lldb/Core/dwarf.h b/lldb/include/lldb/Core/dwarf.h
index af0762ea7b70..e930200393c2 100644
--- a/lldb/include/lldb/Core/dwarf.h
+++ b/lldb/include/lldb/Core/dwarf.h
@@ -21,8 +21,6 @@ namespace dwarf {
}
}
-typedef uint32_t dw_uleb128_t;
-typedef int32_t dw_sleb128_t;
typedef uint16_t dw_attr_t;
typedef uint16_t dw_form_t;
typedef llvm::dwarf::Tag dw_tag_t;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
index 378ba888f4e0..7922a14b33f1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
@@ -22,8 +22,8 @@ public:
// For hand crafting an abbreviation declaration
DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t has_children);
- dw_uleb128_t Code() const { return m_code; }
- void SetCode(dw_uleb128_t code) { m_code = code; }
+ uint32_t Code() const { return m_code; }
+ void SetCode(uint32_t code) { m_code = code; }
dw_tag_t Tag() const { return m_tag; }
bool HasChildren() const { return m_has_children; }
size_t NumAttributes() const { return m_attributes.size(); }
@@ -55,7 +55,7 @@ public:
bool IsValid();
protected:
- dw_uleb128_t m_code = InvalidCode;
+ uint32_t m_code = InvalidCode;
dw_tag_t m_tag = llvm::dwarf::DW_TAG_null;
uint8_t m_has_children = 0;
DWARFAttribute::collection m_attributes;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
index d890288cdf56..2c02fbe64f54 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
@@ -27,7 +27,7 @@ DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data,
m_offset = begin_offset;
Clear();
DWARFAbbreviationDeclaration abbrevDeclaration;
- dw_uleb128_t prev_abbr_code = 0;
+ uint32_t prev_abbr_code = 0;
while (true) {
llvm::Expected<DWARFEnumState> es =
abbrevDeclaration.extract(data, offset_ptr);
@@ -50,7 +50,7 @@ DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data,
// DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration()
const DWARFAbbreviationDeclaration *
DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration(
- dw_uleb128_t abbrCode) const {
+ uint32_t abbrCode) const {
if (m_idx_offset == UINT32_MAX) {
DWARFAbbreviationDeclarationCollConstIter pos;
DWARFAbbreviationDeclarationCollConstIter end = m_decls.end();
@@ -66,7 +66,6 @@ DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration(
return nullptr;
}
-
// DWARFAbbreviationDeclarationSet::GetUnsupportedForms()
void DWARFAbbreviationDeclarationSet::GetUnsupportedForms(
std::set<dw_form_t> &invalid_forms) const {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
index ec6b93ce0e7f..c7a776b0dfbb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
@@ -42,7 +42,7 @@ public:
void GetUnsupportedForms(std::set<dw_form_t> &invalid_forms) const;
const DWARFAbbreviationDeclaration *
- GetAbbreviationDeclaration(dw_uleb128_t abbrCode) const;
+ GetAbbreviationDeclaration(uint32_t abbrCode) const;
/// Unit test accessor functions.
/// @{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index a1578b47ae94..2b1d3b37a95a 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -216,22 +216,22 @@ bool DWARFFormValue::SkipValue(dw_form_t form,
// in the .debug_info
case DW_FORM_exprloc:
case DW_FORM_block: {
- dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr);
+ uint64_t size = debug_info_data.GetULEB128(offset_ptr);
*offset_ptr += size;
}
return true;
case DW_FORM_block1: {
- dw_uleb128_t size = debug_info_data.GetU8(offset_ptr);
+ uint8_t size = debug_info_data.GetU8(offset_ptr);
*offset_ptr += size;
}
return true;
case DW_FORM_block2: {
- dw_uleb128_t size = debug_info_data.GetU16(offset_ptr);
+ uint16_t size = debug_info_data.GetU16(offset_ptr);
*offset_ptr += size;
}
return true;
case DW_FORM_block4: {
- dw_uleb128_t size = debug_info_data.GetU32(offset_ptr);
+ uint32_t size = debug_info_data.GetU32(offset_ptr);
*offset_ptr += size;
}
return true;