Author: Jason Molenda Date: 2023-06-15T17:38:45-07:00 New Revision: 538df1d8a2428d06de7f26c859969ddec14928c1
URL: https://github.com/llvm/llvm-project/commit/538df1d8a2428d06de7f26c859969ddec14928c1 DIFF: https://github.com/llvm/llvm-project/commit/538df1d8a2428d06de7f26c859969ddec14928c1.diff LOG: lldb [NFC] Add logging to Process when address masks are updated To aid in integration testing/debugging. Verifying that the address mask/addressable bits values from different sources are correctly registered by lldb. Added: Modified: lldb/include/lldb/Target/Process.h lldb/source/Target/Process.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 3b9de13206ac8..907ef50a7a61b 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -1376,21 +1376,11 @@ class Process : public std::enable_shared_from_this<Process>, lldb::addr_t GetHighmemCodeAddressMask(); lldb::addr_t GetHighmemDataAddressMask(); - void SetCodeAddressMask(lldb::addr_t code_address_mask) { - m_code_address_mask = code_address_mask; - } - - void SetDataAddressMask(lldb::addr_t data_address_mask) { - m_data_address_mask = data_address_mask; - } + void SetCodeAddressMask(lldb::addr_t code_address_mask); + void SetDataAddressMask(lldb::addr_t data_address_mask); - void SetHighmemCodeAddressMask(lldb::addr_t code_address_mask) { - m_highmem_code_address_mask = code_address_mask; - } - - void SetHighmemDataAddressMask(lldb::addr_t data_address_mask) { - m_highmem_data_address_mask = data_address_mask; - } + void SetHighmemCodeAddressMask(lldb::addr_t code_address_mask); + void SetHighmemDataAddressMask(lldb::addr_t data_address_mask); /// Some targets might use bits in a code address to indicate a mode switch, /// ARM uses bit zero to signify a code address is thumb, so any ARM ABI diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 9730d7217eda3..7ad62976d968d 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -5688,6 +5688,34 @@ lldb::addr_t Process::GetHighmemDataAddressMask() { return GetDataAddressMask(); } +void Process::SetCodeAddressMask(lldb::addr_t code_address_mask) { + Log *log = GetLog(LLDBLog::Process); + LLDB_LOGF(log, "Setting Process code address mask to 0x%" PRIx64, + code_address_mask); + m_code_address_mask = code_address_mask; +} + +void Process::SetDataAddressMask(lldb::addr_t data_address_mask) { + Log *log = GetLog(LLDBLog::Process); + LLDB_LOGF(log, "Setting Process data address mask to 0x%" PRIx64, + data_address_mask); + m_data_address_mask = data_address_mask; +} + +void Process::SetHighmemCodeAddressMask(lldb::addr_t code_address_mask) { + Log *log = GetLog(LLDBLog::Process); + LLDB_LOGF(log, "Setting Process highmem code address mask to 0x%" PRIx64, + code_address_mask); + m_highmem_code_address_mask = code_address_mask; +} + +void Process::SetHighmemDataAddressMask(lldb::addr_t data_address_mask) { + Log *log = GetLog(LLDBLog::Process); + LLDB_LOGF(log, "Setting Process highmem data address mask to 0x%" PRIx64, + data_address_mask); + m_highmem_data_address_mask = data_address_mask; +} + addr_t Process::FixCodeAddress(addr_t addr) { if (ABISP abi_sp = GetABI()) addr = abi_sp->FixCodeAddress(addr); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits