aboutsummaryrefslogtreecommitdiff
path: root/source/Symbol/CompactUnwindInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Symbol/CompactUnwindInfo.cpp')
-rw-r--r--source/Symbol/CompactUnwindInfo.cpp42
1 files changed, 20 insertions, 22 deletions
diff --git a/source/Symbol/CompactUnwindInfo.cpp b/source/Symbol/CompactUnwindInfo.cpp
index 7dda877582cc..6f0f35f278c4 100644
--- a/source/Symbol/CompactUnwindInfo.cpp
+++ b/source/Symbol/CompactUnwindInfo.cpp
@@ -183,8 +183,7 @@ bool CompactUnwindInfo::GetUnwindPlan(Target &target, Address addr,
if (function_info.encoding == 0)
return false;
- ArchSpec arch;
- if (m_objfile.GetArchitecture(arch)) {
+ if (ArchSpec arch = m_objfile.GetArchitecture()) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
if (log && log->GetVerbose()) {
@@ -204,7 +203,7 @@ bool CompactUnwindInfo::GetUnwindPlan(Target &target, Address addr,
if (sl) {
addr_t func_range_start_file_addr =
function_info.valid_range_offset_start +
- m_objfile.GetHeaderAddress().GetFileAddress();
+ m_objfile.GetBaseAddress().GetFileAddress();
AddressRange func_range(func_range_start_file_addr,
function_info.valid_range_offset_end -
function_info.valid_range_offset_start,
@@ -259,7 +258,7 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
m_objfile.GetModule()->LogMessage(
log, "Reading compact unwind first-level indexes");
- if (m_unwindinfo_data_computed == false) {
+ if (!m_unwindinfo_data_computed) {
if (m_section_sp->IsEncrypted()) {
// Can't get section contents of a protected/encrypted section until we
// have a live process and can read them out of memory.
@@ -338,8 +337,7 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
// };
bool clear_address_zeroth_bit = false;
- ArchSpec arch;
- if (m_objfile.GetArchitecture(arch)) {
+ if (ArchSpec arch = m_objfile.GetArchitecture()) {
if (arch.GetTriple().getArch() == llvm::Triple::arm ||
arch.GetTriple().getArch() == llvm::Triple::thumb)
clear_address_zeroth_bit = true;
@@ -513,7 +511,7 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
return false;
addr_t function_offset =
- address.GetFileAddress() - m_objfile.GetHeaderAddress().GetFileAddress();
+ address.GetFileAddress() - m_objfile.GetBaseAddress().GetFileAddress();
UnwindIndex key;
key.function_offset = function_offset;
@@ -529,7 +527,7 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
--it;
}
- if (it->sentinal_entry == true) {
+ if (it->sentinal_entry) {
return false;
}
@@ -578,10 +576,10 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
if (sl) {
uint32_t lsda_offset = GetLSDAForFunctionOffset(
lsda_array_start, lsda_array_count, function_offset);
- addr_t objfile_header_file_address =
- m_objfile.GetHeaderAddress().GetFileAddress();
+ addr_t objfile_base_address =
+ m_objfile.GetBaseAddress().GetFileAddress();
unwind_info.lsda_address.ResolveAddressUsingFileSections(
- objfile_header_file_address + lsda_offset, sl);
+ objfile_base_address + lsda_offset, sl);
}
}
if (unwind_info.encoding & UNWIND_PERSONALITY_MASK) {
@@ -596,10 +594,10 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
SectionList *sl = m_objfile.GetSectionList();
if (sl) {
uint32_t personality_offset = m_unwindinfo_data.GetU32(&offset);
- addr_t objfile_header_file_address =
- m_objfile.GetHeaderAddress().GetFileAddress();
+ addr_t objfile_base_address =
+ m_objfile.GetBaseAddress().GetFileAddress();
unwind_info.personality_ptr_address.ResolveAddressUsingFileSections(
- objfile_header_file_address + personality_offset, sl);
+ objfile_base_address + personality_offset, sl);
}
}
}
@@ -662,10 +660,10 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
if (sl) {
uint32_t lsda_offset = GetLSDAForFunctionOffset(
lsda_array_start, lsda_array_count, function_offset);
- addr_t objfile_header_file_address =
- m_objfile.GetHeaderAddress().GetFileAddress();
+ addr_t objfile_base_address =
+ m_objfile.GetBaseAddress().GetFileAddress();
unwind_info.lsda_address.ResolveAddressUsingFileSections(
- objfile_header_file_address + lsda_offset, sl);
+ objfile_base_address + lsda_offset, sl);
}
}
if (unwind_info.encoding & UNWIND_PERSONALITY_MASK) {
@@ -680,10 +678,10 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
SectionList *sl = m_objfile.GetSectionList();
if (sl) {
uint32_t personality_offset = m_unwindinfo_data.GetU32(&offset);
- addr_t objfile_header_file_address =
- m_objfile.GetHeaderAddress().GetFileAddress();
+ addr_t objfile_base_address =
+ m_objfile.GetBaseAddress().GetFileAddress();
unwind_info.personality_ptr_address.ResolveAddressUsingFileSections(
- objfile_header_file_address + personality_offset, sl);
+ objfile_base_address + personality_offset, sl);
}
}
}
@@ -925,7 +923,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
for (uint32_t i = 0; i < register_count; i++) {
int renum = 0;
for (int j = 1; j < 7; j++) {
- if (used[j] == false) {
+ if (!used[j]) {
if (renum == permunreg[i]) {
registers[i] = j;
used[j] = true;
@@ -1187,7 +1185,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
for (uint32_t i = 0; i < register_count; i++) {
int renum = 0;
for (int j = 1; j < 7; j++) {
- if (used[j] == false) {
+ if (!used[j]) {
if (renum == permunreg[i]) {
registers[i] = j;
used[j] = true;