aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp16
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h1
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h2
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp14
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp16
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp31
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp2
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp12
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp76
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h19
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h6
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp3
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp155
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp2
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp2
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp2
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h8
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp2
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp32
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp4
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp32
21 files changed, 129 insertions, 308 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/contrib/llvm-project/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index 8c54219f0a14..edc5f005c7ac 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -1097,19 +1097,19 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
thumb_arch_name.erase(0, 3);
thumb_arch_name.insert(0, "thumb");
} else {
- thumb_arch_name = "thumbv8.7a";
+ thumb_arch_name = "thumbv9.3a";
}
thumb_arch.GetTriple().setArchName(llvm::StringRef(thumb_arch_name));
}
// If no sub architecture specified then use the most recent arm architecture
- // so the disassembler will return all instruction. Without it we will see a
- // lot of unknow opcode in case the code uses instructions which are not
- // available in the oldest arm version (used when no sub architecture is
- // specified)
+ // so the disassembler will return all instructions. Without it we will see a
+ // lot of unknown opcodes if the code uses instructions which are not
+ // available in the oldest arm version (which is used when no sub architecture
+ // is specified).
if (triple.getArch() == llvm::Triple::arm &&
triple.getSubArch() == llvm::Triple::NoSubArch)
- triple.setArchName("armv8.7a");
+ triple.setArchName("armv9.3a");
std::string features_str;
const char *triple_str = triple.getTriple().c_str();
@@ -1179,9 +1179,9 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
}
// If any AArch64 variant, enable latest ISA with any optional
- // extensions like SVE.
+ // extensions like MTE.
if (triple.isAArch64()) {
- features_str += "+v8.7a,+sve2,+mte";
+ features_str += "+v9.3a,+mte";
if (triple.getVendor() == llvm::Triple::Apple)
cpu = "apple-latest";
diff --git a/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h b/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
index 8060b8c0aedc..151935b0ce68 100644
--- a/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
+++ b/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
@@ -21,7 +21,6 @@
namespace lldb_private {
class ASTStructExtractor;
-class ClangExpressionParser;
/// \class ClangFunctionCaller ClangFunctionCaller.h
/// "lldb/Expression/ClangFunctionCaller.h" Encapsulates a function that can
diff --git a/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
index b628f6debf66..30cdd2f3e990 100644
--- a/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ b/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -28,6 +28,8 @@
namespace lldb_private {
+class ClangExpressionParser;
+
/// \class ClangUserExpression ClangUserExpression.h
/// "lldb/Expression/ClangUserExpression.h" Encapsulates a single expression
/// for use with Clang
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
index 803e5842cd7d..8364ffeef46f 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -40,7 +40,7 @@ StateType GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(
ContinueDelegate &delegate, const UnixSignals &signals,
llvm::StringRef payload, std::chrono::seconds interrupt_timeout,
StringExtractorGDBRemote &response) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
response.Clear();
{
@@ -184,8 +184,7 @@ GDBRemoteClientBase::SendPacketAndWaitForResponse(
std::chrono::seconds interrupt_timeout) {
Lock lock(*this, interrupt_timeout);
if (!lock) {
- if (Log *log =
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS))
+ if (Log *log = GetLog(GDBRLog::Process))
LLDB_LOGF(log,
"GDBRemoteClientBase::%s failed to get mutex, not sending "
"packet '%.*s'",
@@ -203,8 +202,7 @@ GDBRemoteClientBase::SendPacketAndReceiveResponseWithOutputSupport(
llvm::function_ref<void(llvm::StringRef)> output_callback) {
Lock lock(*this, interrupt_timeout);
if (!lock) {
- if (Log *log =
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS))
+ if (Log *log = GetLog(GDBRLog::Process))
LLDB_LOGF(log,
"GDBRemoteClientBase::%s failed to get mutex, not sending "
"packet '%.*s'",
@@ -237,7 +235,7 @@ GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock(
if (response.ValidateResponse())
return packet_result;
// Response says it wasn't valid
- Log *log = ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS);
+ Log *log = GetLog(GDBRLog::Packets);
LLDB_LOGF(
log,
"error: packet with payload \"%.*s\" got invalid response \"%s\": %s",
@@ -311,7 +309,7 @@ void GDBRemoteClientBase::ContinueLock::unlock() {
GDBRemoteClientBase::ContinueLock::LockResult
GDBRemoteClientBase::ContinueLock::lock() {
- Log *log = ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS);
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "GDBRemoteClientBase::ContinueLock::%s() resuming with %s",
__FUNCTION__, m_comm.m_continue_packet.c_str());
@@ -349,7 +347,7 @@ GDBRemoteClientBase::Lock::Lock(GDBRemoteClientBase &comm,
}
void GDBRemoteClientBase::Lock::SyncWithContinueThread() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
std::unique_lock<std::mutex> lock(m_comm.m_mutex);
if (m_comm.m_is_running && m_interrupt_timeout == std::chrono::seconds(0))
return; // We were asked to avoid interrupting the sender. Lock is not
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 25ae08838bf8..38d9e400978d 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -93,7 +93,7 @@ char GDBRemoteCommunication::CalculcateChecksum(llvm::StringRef payload) {
}
size_t GDBRemoteCommunication::SendAck() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '+';
const size_t bytes_written = WriteAll(&ch, 1, status, nullptr);
@@ -103,7 +103,7 @@ size_t GDBRemoteCommunication::SendAck() {
}
size_t GDBRemoteCommunication::SendNack() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '-';
const size_t bytes_written = WriteAll(&ch, 1, status, nullptr);
@@ -128,7 +128,7 @@ GDBRemoteCommunication::PacketResult
GDBRemoteCommunication::SendRawPacketNoLock(llvm::StringRef packet,
bool skip_ack) {
if (IsConnected()) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
ConnectionStatus status = eConnectionStatusSuccess;
const char *packet_data = packet.data();
const size_t packet_length = packet.size();
@@ -222,7 +222,7 @@ GDBRemoteCommunication::ReadPacket(StringExtractorGDBRemote &response,
bool sync_on_timeout) {
using ResponseType = StringExtractorGDBRemote::ResponseType;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
for (;;) {
PacketResult result =
WaitForPacketNoLock(response, timeout, sync_on_timeout);
@@ -241,7 +241,7 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
uint8_t buffer[8192];
Status error;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
// Check for a packet from our cache first without trying any reading...
if (CheckForPacket(nullptr, 0, packet) != PacketType::Invalid)
@@ -382,7 +382,7 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
}
bool GDBRemoteCommunication::DecompressPacket() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
if (!CompressionIsEnabled())
return true;
@@ -616,7 +616,7 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
// Put the packet data into the buffer in a thread safe fashion
std::lock_guard<std::recursive_mutex> guard(m_bytes_mutex);
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
if (src && src_len > 0) {
if (log && log->GetVerbose()) {
@@ -881,7 +881,7 @@ GDBRemoteCommunication::ListenThread(lldb::thread_arg_t arg) {
Status GDBRemoteCommunication::StartDebugserverProcess(
const char *url, Platform *platform, ProcessLaunchInfo &launch_info,
uint16_t *port, const Args *inferior_args, int pass_comm_fd) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "GDBRemoteCommunication::%s(url=%s, port=%" PRIu16 ")",
__FUNCTION__, url ? url : "<empty>", port ? *port : uint16_t(0));
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index f6526d03863b..91b9151328a8 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -399,8 +399,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
packet_response.GetHexMaxU64(/*little_endian=*/false, UINT64_MAX);
if (m_max_packet_size == 0) {
m_max_packet_size = UINT64_MAX; // Must have been a garbled response
- Log *log(
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log(GetLog(GDBRLog::Process));
LLDB_LOGF(log, "Garbled PacketSize spec in qSupported response");
}
}
@@ -485,8 +484,7 @@ GDBRemoteCommunicationClient::SendThreadSpecificPacketAndWaitForResponse(
StringExtractorGDBRemote &response) {
Lock lock(*this);
if (!lock) {
- if (Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(
- GDBR_LOG_PROCESS | GDBR_LOG_PACKETS))
+ if (Log *log = GetLog(GDBRLog::Process | GDBRLog::Packets))
LLDB_LOGF(log,
"GDBRemoteCommunicationClient::%s: Didn't get sequence mutex "
"for %s packet.",
@@ -622,7 +620,7 @@ DataBufferSP GDBRemoteCommunicationClient::ReadMemoryTags(lldb::addr_t addr,
packet.Printf("qMemTags:%" PRIx64 ",%zx:%" PRIx32, addr, len, type);
StringExtractorGDBRemote response;
- Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_MEMORY);
+ Log *log = GetLog(GDBRLog::Memory);
if (SendPacketAndWaitForResponse(packet.GetString(), response) !=
PacketResult::Success ||
@@ -1200,7 +1198,7 @@ static void ParseOSType(llvm::StringRef value, std::string &os_name,
}
bool GDBRemoteCommunicationClient::GetHostInfo(bool force) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
if (force || m_qHostInfo_is_valid == eLazyBoolCalculate) {
// host info computation can require DNS traffic and shelling out to external processes.
@@ -2110,8 +2108,7 @@ bool GDBRemoteCommunicationClient::GetProcessInfo(
}
bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS |
- GDBR_LOG_PACKETS));
+ Log *log(GetLog(GDBRLog::Process | GDBRLog::Packets));
if (allow_lazy) {
if (m_qProcessInfo_is_valid == eLazyBoolYes)
@@ -2887,8 +2884,7 @@ GDBRemoteCommunicationClient::GetCurrentProcessAndThreadIDs(
ids.emplace_back(1, 1);
}
} else {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS |
- GDBR_LOG_PACKETS));
+ Log *log(GetLog(GDBRLog::Process | GDBRLog::Packets));
LLDB_LOG(log, "error: failed to get packet sequence mutex, not sending "
"packet 'qfThreadInfo'");
sequence_mutex_unavailable = true;
@@ -3557,7 +3553,7 @@ bool GDBRemoteCommunicationClient::SyncThreadState(lldb::tid_t tid) {
llvm::Expected<TraceSupportedResponse>
GDBRemoteCommunicationClient::SendTraceSupported(std::chrono::seconds timeout) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
StreamGDBRemote escaped_packet;
escaped_packet.PutCString("jLLDBTraceSupported");
@@ -3583,7 +3579,7 @@ GDBRemoteCommunicationClient::SendTraceSupported(std::chrono::seconds timeout) {
llvm::Error
GDBRemoteCommunicationClient::SendTraceStop(const TraceStopRequest &request,
std::chrono::seconds timeout) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
StreamGDBRemote escaped_packet;
escaped_packet.PutCString("jLLDBTraceStop:");
@@ -3618,7 +3614,7 @@ GDBRemoteCommunicationClient::SendTraceStop(const TraceStopRequest &request,
llvm::Error
GDBRemoteCommunicationClient::SendTraceStart(const llvm::json::Value &params,
std::chrono::seconds timeout) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
StreamGDBRemote escaped_packet;
escaped_packet.PutCString("jLLDBTraceStart:");
@@ -3653,7 +3649,7 @@ GDBRemoteCommunicationClient::SendTraceStart(const llvm::json::Value &params,
llvm::Expected<std::string>
GDBRemoteCommunicationClient::SendTraceGetState(llvm::StringRef type,
std::chrono::seconds timeout) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
StreamGDBRemote escaped_packet;
escaped_packet.PutCString("jLLDBTraceGetState:");
@@ -3687,7 +3683,7 @@ GDBRemoteCommunicationClient::SendTraceGetState(llvm::StringRef type,
llvm::Expected<std::vector<uint8_t>>
GDBRemoteCommunicationClient::SendTraceGetBinaryData(
const TraceGetBinaryDataRequest &request, std::chrono::seconds timeout) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
StreamGDBRemote escaped_packet;
escaped_packet.PutCString("jLLDBTraceGetBinaryData:");
@@ -4132,8 +4128,7 @@ void GDBRemoteCommunicationClient::ServeSymbolLookups(
// our symbol lookup failed so we must abort
return;
- } else if (Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(
- GDBR_LOG_PROCESS | GDBR_LOG_PACKETS)) {
+ } else if (Log *log = GetLog(GDBRLog::Process | GDBRLog::Packets)) {
LLDB_LOGF(log,
"GDBRemoteCommunicationClient::%s: Didn't get sequence mutex.",
__FUNCTION__);
@@ -4147,7 +4142,7 @@ GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins() {
// Query the server for the array of supported asynchronous JSON packets.
m_supported_async_json_packets_is_valid = true;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
// Poll it now.
StringExtractorGDBRemote response;
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 49d88b72b01b..7d21b0ff01da 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -138,7 +138,7 @@ GDBRemoteCommunicationServer::Handle_QErrorStringEnable(
GDBRemoteCommunication::PacketResult
GDBRemoteCommunicationServer::SendIllFormedResponse(
const StringExtractorGDBRemote &failed_packet, const char *message) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
LLDB_LOGF(log, "GDBRemoteCommunicationServer::%s: ILLFORMED: '%s' (%s)",
__FUNCTION__, failed_packet.GetStringRef().data(),
message ? message : "");
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 9410c9bd83ec..1b66e8c16281 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -238,8 +238,7 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info) {
if (GetRegisterIsValid(reg))
return true;
} else {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_THREAD |
- GDBR_LOG_PACKETS));
+ Log *log(GetLog(GDBRLog::Thread | GDBRLog::Packets));
LLDB_LOGF(
log,
"error: GDBRemoteRegisterContext::ReadRegisterBytes tried "
@@ -454,8 +453,7 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
return success;
}
} else {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_THREAD |
- GDBR_LOG_PACKETS));
+ Log *log(GetLog(GDBRLog::Thread | GDBRLog::Packets));
if (log) {
if (log->GetVerbose()) {
StreamString strm;
@@ -560,8 +558,7 @@ bool GDBRemoteRegisterContext::ReadAllRegisterValues(
return true;
} else {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_THREAD |
- GDBR_LOG_PACKETS));
+ Log *log(GetLog(GDBRLog::Thread | GDBRLog::Packets));
if (log) {
if (log->GetVerbose()) {
StreamString strm;
@@ -736,8 +733,7 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
return num_restored > 0;
}
} else {
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_THREAD |
- GDBR_LOG_PACKETS));
+ Log *log(GetLog(GDBRLog::Thread | GDBRLog::Packets));
if (log) {
if (log->GetVerbose()) {
StreamString strm;
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 5f3c1ad9c1e1..df927fe68b4f 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -271,7 +271,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
m_gdb_comm.SetPacketRecorder(provider.GetNewPacketRecorder());
}
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_ASYNC));
+ Log *log = GetLog(GDBRLog::Async);
const uint32_t async_event_mask =
eBroadcastBitAsyncContinue | eBroadcastBitAsyncThreadShouldExit;
@@ -707,7 +707,7 @@ Status ProcessGDBRemote::WillLaunchOrAttach() {
// Process Control
Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module,
ProcessLaunchInfo &launch_info) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
Status error;
LLDB_LOGF(log, "ProcessGDBRemote::%s() entered", __FUNCTION__);
@@ -899,7 +899,7 @@ Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module,
Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) {
Status error;
// Only connect if we have a valid connect URL
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
if (!connect_url.empty()) {
LLDB_LOGF(log, "ProcessGDBRemote::%s Connecting to %s", __FUNCTION__,
@@ -960,7 +960,7 @@ Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) {
}
void ProcessGDBRemote::DidLaunchOrAttach(ArchSpec &process_arch) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
BuildDynamicRegisterInfo(false);
// See if the GDB server supports qHostInfo or qProcessInfo packets. Prefer
@@ -1096,7 +1096,7 @@ void ProcessGDBRemote::DidLaunch() {
Status ProcessGDBRemote::DoAttachToProcessWithID(
lldb::pid_t attach_pid, const ProcessAttachInfo &attach_info) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
Status error;
LLDB_LOGF(log, "ProcessGDBRemote::%s()", __FUNCTION__);
@@ -1205,7 +1205,7 @@ Status ProcessGDBRemote::WillResume() {
Status ProcessGDBRemote::DoResume() {
Status error;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::Resume()");
ListenerSP listener_sp(
@@ -1515,7 +1515,7 @@ bool ProcessGDBRemote::UpdateThreadIDList() {
bool ProcessGDBRemote::DoUpdateThreadList(ThreadList &old_thread_list,
ThreadList &new_thread_list) {
// locker will keep a mutex locked until it goes out of scope
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_THREAD));
+ Log *log = GetLog(GDBRLog::Thread);
LLDB_LOGV(log, "pid = {0}", GetID());
size_t num_thread_ids = m_thread_ids.size();
@@ -1795,8 +1795,7 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
}
}
if (watch_id == LLDB_INVALID_WATCH_ID) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(
- GDBR_LOG_WATCHPOINTS));
+ Log *log(GetLog(GDBRLog::Watchpoints));
LLDB_LOGF(log, "failed to find watchpoint");
}
thread_sp->SetStopInfo(StopInfo::CreateStopReasonWithWatchpointID(
@@ -2238,8 +2237,7 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
} else if (key.compare("library") == 0) {
auto error = LoadModules();
if (error) {
- Log *log(
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log(GetLog(GDBRLog::Process));
LLDB_LOG_ERROR(log, std::move(error), "Failed to load modules: {0}");
}
} else if (key.compare("fork") == 0 || key.compare("vfork") == 0) {
@@ -2247,8 +2245,7 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
StringExtractorGDBRemote thread_id{value};
auto pid_tid = thread_id.GetPidTid(LLDB_INVALID_PROCESS_ID);
if (!pid_tid) {
- Log *log(
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log(GetLog(GDBRLog::Process));
LLDB_LOG(log, "Invalid PID/TID to fork: {0}", value);
pid_tid = {{LLDB_INVALID_PROCESS_ID, LLDB_INVALID_THREAD_ID}};
}
@@ -2265,7 +2262,7 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
}
if (stop_pid != LLDB_INVALID_PROCESS_ID && stop_pid != pid) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOG(log,
"Received stop for incorrect PID = {0} (inferior PID = {1})",
stop_pid, pid);
@@ -2352,7 +2349,7 @@ Status ProcessGDBRemote::DoHalt(bool &caused_stop) {
Status ProcessGDBRemote::DoDetach(bool keep_stopped) {
Status error;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::DoDetach(keep_stopped: %i)", keep_stopped);
error = m_gdb_comm.Detach(keep_stopped);
@@ -2381,7 +2378,7 @@ Status ProcessGDBRemote::DoDetach(bool keep_stopped) {
Status ProcessGDBRemote::DoDestroy() {
Status error;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::DoDestroy()");
#ifdef LLDB_ENABLE_ALL // XXX Currently no iOS target support on FreeBSD
@@ -2565,7 +2562,7 @@ void ProcessGDBRemote::SetLastStopPacket(
const bool did_exec =
response.GetStringRef().find(";reason:exec;") != std::string::npos;
if (did_exec) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::SetLastStopPacket () - detected exec");
m_thread_list_real.Clear();
@@ -2595,7 +2592,7 @@ addr_t ProcessGDBRemote::GetImageInfoAddress() {
if (addr == LLDB_INVALID_ADDRESS) {
llvm::Expected<LoadedModuleInfoList> list = GetLoadedModuleList();
if (!list) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOG_ERROR(log, list.takeError(), "Failed to read module list: {0}.");
} else {
addr = list->m_link_map;
@@ -3040,7 +3037,7 @@ Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
assert(bp_site != nullptr);
// Get logging info
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
+ Log *log = GetLog(GDBRLog::Breakpoints);
user_id_t site_id = bp_site->GetID();
// Get the breakpoint address
@@ -3164,7 +3161,7 @@ Status ProcessGDBRemote::DisableBreakpointSite(BreakpointSite *bp_site) {
assert(bp_site != nullptr);
addr_t addr = bp_site->GetLoadAddress();
user_id_t site_id = bp_site->GetID();
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
+ Log *log = GetLog(GDBRLog::Breakpoints);
LLDB_LOGF(log,
"ProcessGDBRemote::DisableBreakpointSite (site_id = %" PRIu64
") addr = 0x%8.8" PRIx64,
@@ -3229,8 +3226,7 @@ Status ProcessGDBRemote::EnableWatchpoint(Watchpoint *wp, bool notify) {
if (wp) {
user_id_t watchID = wp->GetID();
addr_t addr = wp->GetLoadAddress();
- Log *log(
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_WATCHPOINTS));
+ Log *log(GetLog(GDBRLog::Watchpoints));
LLDB_LOGF(log, "ProcessGDBRemote::EnableWatchpoint(watchID = %" PRIu64 ")",
watchID);
if (wp->IsEnabled()) {
@@ -3266,8 +3262,7 @@ Status ProcessGDBRemote::DisableWatchpoint(Watchpoint *wp, bool notify) {
if (wp) {
user_id_t watchID = wp->GetID();
- Log *log(
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_WATCHPOINTS));
+ Log *log(GetLog(GDBRLog::Watchpoints));
addr_t addr = wp->GetLoadAddress();
@@ -3315,7 +3310,7 @@ void ProcessGDBRemote::Clear() {
Status ProcessGDBRemote::DoSignal(int signo) {
Status error;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::DoSignal (signal = %d)", signo);
if (!m_gdb_comm.SendAsyncSignal(signo, GetInterruptTimeout()))
@@ -3436,7 +3431,7 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
}
if (error.Fail()) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "failed to start debugserver process: %s",
error.AsCString());
@@ -3462,7 +3457,7 @@ bool ProcessGDBRemote::MonitorDebugserverProcess(
) {
// "debugserver_pid" argument passed in is the process ID for debugserver
// that we are tracking...
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
const bool handled = true;
LLDB_LOGF(log,
@@ -3541,7 +3536,7 @@ void ProcessGDBRemote::DebuggerInitialize(Debugger &debugger) {
}
bool ProcessGDBRemote::StartAsyncThread() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::%s ()", __FUNCTION__);
@@ -3569,7 +3564,7 @@ bool ProcessGDBRemote::StartAsyncThread() {
}
void ProcessGDBRemote::StopAsyncThread() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "ProcessGDBRemote::%s ()", __FUNCTION__);
@@ -3593,7 +3588,7 @@ void ProcessGDBRemote::StopAsyncThread() {
thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
ProcessGDBRemote *process = (ProcessGDBRemote *)arg;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log,
"ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64
") thread starting...",
@@ -3796,7 +3791,7 @@ bool ProcessGDBRemote::NewThreadNotifyBreakpointHit(
}
Status ProcessGDBRemote::UpdateAutomaticSignalFiltering() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOG(log, "Check if need to update ignored signals");
// QPassSignals package is not supported by the server, there is no way we
@@ -3900,9 +3895,7 @@ DataExtractor ProcessGDBRemote::GetAuxvData() {
buf = std::make_shared<DataBufferHeap>(response->c_str(),
response->length());
else
- LLDB_LOG_ERROR(
- ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS),
- response.takeError(), "{0}");
+ LLDB_LOG_ERROR(GetLog(GDBRLog::Process), response.takeError(), "{0}");
}
return DataExtractor(buf, GetByteOrder(), GetAddressByteSize());
}
@@ -4090,8 +4083,7 @@ void ProcessGDBRemote::GetMaxMemorySize() {
else {
// In unlikely scenario that max packet size is less then 70, we will
// hope that data being written is small enough to fit.
- Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(
- GDBR_LOG_COMM | GDBR_LOG_MEMORY));
+ Log *log(GetLog(GDBRLog::Comm | GDBRLog::Memory));
if (log)
log->Warning("Packet size is too small. "
"LLDB may face problems while writing memory");
@@ -4270,8 +4262,7 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
SplitCommaSeparatedRegisterNumberString(
value, reg_info.invalidate_regs, 0);
} else {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(
- GDBR_LOG_PROCESS));
+ Log *log(GetLog(GDBRLog::Process));
LLDB_LOGF(log,
"ProcessGDBRemote::%s unhandled reg attribute %s = %s",
__FUNCTION__, name.data(), value.data());
@@ -4313,8 +4304,7 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
}
if (reg_info.byte_size == 0) {
- Log *log(
- ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log(GetLog(GDBRLog::Process));
LLDB_LOGF(log,
"ProcessGDBRemote::%s Skipping zero bitsize register %s",
__FUNCTION__, reg_info.name.AsCString());
@@ -4986,7 +4976,7 @@ static const char *const s_async_json_packet_prefix = "JSON-async:";
static StructuredData::ObjectSP
ParseStructuredDataPacket(llvm::StringRef packet) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
if (!packet.consume_front(s_async_json_packet_prefix)) {
if (log) {
@@ -5359,7 +5349,7 @@ void ProcessGDBRemote::DidForkSwitchHardwareTraps(bool enable) {
}
void ProcessGDBRemote::DidFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
lldb::pid_t parent_pid = m_gdb_comm.GetCurrentProcessID();
// Any valid TID will suffice, thread-relevant actions will set a proper TID
@@ -5421,7 +5411,7 @@ void ProcessGDBRemote::DidFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {
}
void ProcessGDBRemote::DidVFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
assert(!m_vfork_in_progress);
m_vfork_in_progress = true;
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
index 44e390ec8cad..730384204393 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
@@ -29,28 +29,9 @@ enum class GDBRLog : Log::MaskType {
LLVM_MARK_AS_BITMASK_ENUM(Watchpoints)
};
-#define GDBR_LOG_PROCESS ::lldb_private::process_gdb_remote::GDBRLog::Process
-#define GDBR_LOG_THREAD ::lldb_private::process_gdb_remote::GDBRLog::Thread
-#define GDBR_LOG_PACKETS ::lldb_private::process_gdb_remote::GDBRLog::Packets
-#define GDBR_LOG_MEMORY ::lldb_private::process_gdb_remote::GDBRLog::Memory
-#define GDBR_LOG_MEMORY_DATA_SHORT \
- ::lldb_private::process_gdb_remote::GDBRLog::MemoryDataShort
-#define GDBR_LOG_MEMORY_DATA_LONG \
- ::lldb_private::process_gdb_remote::GDBRLog::MemoryDataLong
-#define GDBR_LOG_BREAKPOINTS \
- ::lldb_private::process_gdb_remote::GDBRLog::Breakpoints
-#define GDBR_LOG_WATCHPOINTS \
- ::lldb_private::process_gdb_remote::GDBRLog::Watchpoints
-#define GDBR_LOG_STEP ::lldb_private::process_gdb_remote::GDBRLog::Step
-#define GDBR_LOG_COMM ::lldb_private::process_gdb_remote::GDBRLog::Comm
-#define GDBR_LOG_ASYNC ::lldb_private::process_gdb_remote::GDBRLog::Async
-
class ProcessGDBRemoteLog {
public:
static void Initialize();
-
- static Log *GetLogIfAllCategoriesSet(GDBRLog mask) { return GetLog(mask); }
- static Log *GetLogIfAnyCategoryIsSet(GDBRLog mask) { return GetLog(mask); }
};
} // namespace process_gdb_remote
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
index fb83c74fd2c5..5bc90a3dedce 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
@@ -90,9 +90,6 @@ public:
StructuredData::ObjectSP FetchThreadExtendedInfo() override;
- llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
- GetSiginfo(size_t max_size) const override;
-
protected:
friend class ProcessGDBRemote;
@@ -118,6 +115,9 @@ protected:
void SetStopInfoFromPacket(StringExtractor &stop_packet, uint32_t stop_id);
bool CalculateStopInfo() override;
+
+ llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
+ GetSiginfo(size_t max_size) const override;
};
} // namespace process_gdb_remote
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
index 4e09b523b778..ec4057efbbc5 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
@@ -122,8 +122,7 @@ void AppleDWARFIndex::GetTypes(
if (!m_apple_types_up)
return;
- Log *log = LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS);
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
const bool has_tag = m_apple_types_up->GetHeader().header_data.ContainsAtom(
DWARFMappedHash::eAtomTypeTag);
const bool has_qualified_name_hash =
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index be555c130bfe..2daffecee58e 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -443,8 +443,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (!die)
return nullptr;
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
SymbolFileDWARF *dwarf = die.GetDWARF();
if (log) {
@@ -548,8 +547,7 @@ lldb::TypeSP
DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
const DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs) {
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
SymbolFileDWARF *dwarf = die.GetDWARF();
const dw_tag_t tag = die.Tag();
LanguageType cu_language = SymbolFileDWARF::GetLanguage(*die.GetCU());
@@ -771,8 +769,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
TypeSP DWARFASTParserClang::ParseEnum(const SymbolContext &sc,
const DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs) {
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
SymbolFileDWARF *dwarf = die.GetDWARF();
const dw_tag_t tag = die.Tag();
TypeSP type_sp;
@@ -900,8 +897,7 @@ ConvertDWARFCallingConventionToClang(const ParsedDWARFTypeAttributes &attrs) {
break;
}
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
LLDB_LOG(log, "Unsupported DW_AT_calling_convention value: {0}",
attrs.calling_convention);
// Use the default calling convention as a fallback.
@@ -910,8 +906,7 @@ ConvertDWARFCallingConventionToClang(const ParsedDWARFTypeAttributes &attrs) {
TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs) {
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
SymbolFileDWARF *dwarf = die.GetDWARF();
const dw_tag_t tag = die.Tag();
@@ -1562,8 +1557,7 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
const dw_tag_t tag = die.Tag();
SymbolFileDWARF *dwarf = die.GetDWARF();
LanguageType cu_language = SymbolFileDWARF::GetLanguage(*die.GetCU());
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS);
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
// UniqueDWARFASTType is large, so don't create a local variables on the
// stack, put it on the heap. This function is often called recursively and
@@ -2214,12 +2208,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
const dw_tag_t tag = die.Tag();
- Log *log =
- nullptr; // (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO|DWARF_LOG_TYPE_COMPLETION));
- if (log)
- dwarf->GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(
- log, "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...",
- die.GetID(), die.GetTagAsCString(), type->GetName().AsCString());
assert(clang_type);
DWARFAttributes attributes;
switch (tag) {
@@ -3452,30 +3440,6 @@ DWARFASTParserClang::ResolveNamespaceDIE(const DWARFDIE &die) {
namespace_decl = m_ast.GetUniqueNamespaceDeclaration(
namespace_name, containing_decl_ctx, GetOwningClangModule(die),
is_inline);
- Log *log =
- nullptr; // (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
- if (log) {
- SymbolFileDWARF *dwarf = die.GetDWARF();
- if (namespace_name) {
- dwarf->GetObjectFile()->GetModule()->LogMessage(
- log,
- "ASTContext => %p: 0x%8.8" PRIx64
- ": DW_TAG_namespace with DW_AT_name(\"%s\") => "
- "clang::NamespaceDecl *%p (original = %p)",
- static_cast<void *>(&m_ast.getASTContext()), die.GetID(),
- namespace_name, static_cast<void *>(namespace_decl),
- static_cast<void *>(namespace_decl->getOriginalNamespace()));
- } else {
- dwarf->GetObjectFile()->GetModule()->LogMessage(
- log,
- "ASTContext => %p: 0x%8.8" PRIx64
- ": DW_TAG_namespace (anonymous) => clang::NamespaceDecl *%p "
- "(original = %p)",
- static_cast<void *>(&m_ast.getASTContext()), die.GetID(),
- static_cast<void *>(namespace_decl),
- static_cast<void *>(namespace_decl->getOriginalNamespace()));
- }
- }
if (namespace_decl)
LinkDeclContextToDIE((clang::DeclContext *)namespace_decl, die);
@@ -3580,23 +3544,12 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
}
const uint32_t src_size = src_name_to_die.GetSize();
const uint32_t dst_size = dst_name_to_die.GetSize();
- Log *log = nullptr; // (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO |
- // DWARF_LOG_TYPE_COMPLETION));
// Is everything kosher so we can go through the members at top speed?
bool fast_path = true;
- if (src_size != dst_size) {
- if (src_size != 0 && dst_size != 0) {
- LLDB_LOGF(log,
- "warning: trying to unique class DIE 0x%8.8x to 0x%8.8x, "
- "but they didn't have the same size (src=%d, dst=%d)",
- src_class_die.GetOffset(), dst_class_die.GetOffset(), src_size,
- dst_size);
- }
-
+ if (src_size != dst_size)
fast_path = false;
- }
uint32_t idx;
@@ -3605,15 +3558,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
src_die = src_name_to_die.GetValueAtIndexUnchecked(idx);
dst_die = dst_name_to_die.GetValueAtIndexUnchecked(idx);
- if (src_die.Tag() != dst_die.Tag()) {
- LLDB_LOGF(log,
- "warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, "
- "but 0x%8.8x (%s) tags didn't match 0x%8.8x (%s)",
- src_class_die.GetOffset(), dst_class_die.GetOffset(),
- src_die.GetOffset(), src_die.GetTagAsCString(),
- dst_die.GetOffset(), dst_die.GetTagAsCString());
+ if (src_die.Tag() != dst_die.Tag())
fast_path = false;
- }
const char *src_name = src_die.GetMangledName();
const char *dst_name = dst_die.GetMangledName();
@@ -3622,12 +3568,6 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
if (src_name == dst_name || (strcmp(src_name, dst_name) == 0))
continue;
- LLDB_LOGF(log,
- "warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, "
- "but 0x%8.8x (%s) names didn't match 0x%8.8x (%s)",
- src_class_die.GetOffset(), dst_class_die.GetOffset(),
- src_die.GetOffset(), src_name, dst_die.GetOffset(), dst_name);
-
fast_path = false;
}
}
@@ -3649,33 +3589,13 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
clang::DeclContext *src_decl_ctx =
src_dwarf_ast_parser->m_die_to_decl_ctx[src_die.GetDIE()];
- if (src_decl_ctx) {
- LLDB_LOGF(log, "uniquing decl context %p from 0x%8.8x for 0x%8.8x",
- static_cast<void *>(src_decl_ctx), src_die.GetOffset(),
- dst_die.GetOffset());
+ if (src_decl_ctx)
dst_dwarf_ast_parser->LinkDeclContextToDIE(src_decl_ctx, dst_die);
- } else {
- LLDB_LOGF(log,
- "warning: tried to unique decl context from 0x%8.8x for "
- "0x%8.8x, but none was found",
- src_die.GetOffset(), dst_die.GetOffset());
- }
Type *src_child_type =
dst_die.GetDWARF()->GetDIEToType()[src_die.GetDIE()];
- if (src_child_type) {
- LLDB_LOGF(log,
- "uniquing type %p (uid=0x%" PRIx64
- ") from 0x%8.8x for 0x%8.8x",
- static_cast<void *>(src_child_type), src_child_type->GetID(),
- src_die.GetOffset(), dst_die.GetOffset());
+ if (src_child_type)
dst_die.GetDWARF()->GetDIEToType()[dst_die.GetDIE()] = src_child_type;
- } else {
- LLDB_LOGF(log,
- "warning: tried to unique lldb_private::Type from "
- "0x%8.8x for 0x%8.8x, but none was found",
- src_die.GetOffset(), dst_die.GetOffset());
- }
}
} else {
// We must do this slowly. For each member of the destination, look up a
@@ -3693,38 +3613,16 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
if (src_die && (src_die.Tag() == dst_die.Tag())) {
clang::DeclContext *src_decl_ctx =
src_dwarf_ast_parser->m_die_to_decl_ctx[src_die.GetDIE()];
- if (src_decl_ctx) {
- LLDB_LOGF(log, "uniquing decl context %p from 0x%8.8x for 0x%8.8x",
- static_cast<void *>(src_decl_ctx), src_die.GetOffset(),
- dst_die.GetOffset());
+ if (src_decl_ctx)
dst_dwarf_ast_parser->LinkDeclContextToDIE(src_decl_ctx, dst_die);
- } else {
- LLDB_LOGF(log,
- "warning: tried to unique decl context from 0x%8.8x "
- "for 0x%8.8x, but none was found",
- src_die.GetOffset(), dst_die.GetOffset());
- }
Type *src_child_type =
dst_die.GetDWARF()->GetDIEToType()[src_die.GetDIE()];
if (src_child_type) {
- LLDB_LOGF(
- log,
- "uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x",
- static_cast<void *>(src_child_type), src_child_type->GetID(),
- src_die.GetOffset(), dst_die.GetOffset());
dst_die.GetDWARF()->GetDIEToType()[dst_die.GetDIE()] =
src_child_type;
- } else {
- LLDB_LOGF(log,
- "warning: tried to unique lldb_private::Type from "
- "0x%8.8x for 0x%8.8x, but none was found",
- src_die.GetOffset(), dst_die.GetOffset());
}
} else {
- LLDB_LOGF(log, "warning: couldn't find a match for 0x%8.8x",
- dst_die.GetOffset());
-
failures.push_back(dst_die);
}
}
@@ -3748,47 +3646,20 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
// Both classes have the artificial types, link them
clang::DeclContext *src_decl_ctx =
src_dwarf_ast_parser->m_die_to_decl_ctx[src_die.GetDIE()];
- if (src_decl_ctx) {
- LLDB_LOGF(log, "uniquing decl context %p from 0x%8.8x for 0x%8.8x",
- static_cast<void *>(src_decl_ctx), src_die.GetOffset(),
- dst_die.GetOffset());
+ if (src_decl_ctx)
dst_dwarf_ast_parser->LinkDeclContextToDIE(src_decl_ctx, dst_die);
- } else {
- LLDB_LOGF(log,
- "warning: tried to unique decl context from 0x%8.8x "
- "for 0x%8.8x, but none was found",
- src_die.GetOffset(), dst_die.GetOffset());
- }
Type *src_child_type =
dst_die.GetDWARF()->GetDIEToType()[src_die.GetDIE()];
- if (src_child_type) {
- LLDB_LOGF(
- log,
- "uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x",
- static_cast<void *>(src_child_type), src_child_type->GetID(),
- src_die.GetOffset(), dst_die.GetOffset());
+ if (src_child_type)
dst_die.GetDWARF()->GetDIEToType()[dst_die.GetDIE()] = src_child_type;
- } else {
- LLDB_LOGF(log,
- "warning: tried to unique lldb_private::Type from "
- "0x%8.8x for 0x%8.8x, but none was found",
- src_die.GetOffset(), dst_die.GetOffset());
- }
}
}
}
if (dst_size_artificial) {
for (idx = 0; idx < dst_size_artificial; ++idx) {
- ConstString dst_name_artificial =
- dst_name_to_die_artificial.GetCStringAtIndex(idx);
dst_die = dst_name_to_die_artificial.GetValueAtIndexUnchecked(idx);
- LLDB_LOGF(log,
- "warning: need to create artificial method for 0x%8.8x for "
- "method '%s'",
- dst_die.GetOffset(), dst_name_artificial.GetCString());
-
failures.push_back(dst_die);
}
}
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
index ce514381ee39..03cbfd28ae74 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
@@ -138,7 +138,7 @@ llvm::Error DWARFDebugArangeSet::extract(const DWARFDataExtractor &data,
}
}
if (num_terminators > 1) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
LLDB_LOG(log,
"warning: DWARFDebugArangeSet at %#" PRIx64 " contains %u "
"terminator entries",
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index 65923cb4ad6b..a37499175858 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -40,7 +40,7 @@ void DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) {
while (debug_aranges_data.ValidOffset(offset)) {
const lldb::offset_t set_offset = offset;
if (llvm::Error error = set.extract(debug_aranges_data, &offset)) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
LLDB_LOG_ERROR(log, std::move(error),
"DWARFDebugAranges::extract failed to extract "
".debug_aranges set at offset %#" PRIx64,
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index 4a148e7744bb..2350c8fc3d5b 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -77,7 +77,7 @@ void DebugNamesDWARFIndex::MaybeLogLookupError(llvm::Error error,
llvm::StringRef name) {
// Ignore SentinelErrors, log everything else.
LLDB_LOG_ERROR(
- LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS),
+ GetLog(DWARFLog::Lookups),
handleErrors(std::move(error), [](const DebugNames::SentinelError &) {}),
"Failed to parse index entries for index at {1:x}, name {2}: {0}",
ni.getUnitOffset(), name);
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
index 8076c719e9c4..aa3ed4afed25 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
@@ -21,19 +21,11 @@ enum class DWARFLog : Log::MaskType {
TypeCompletion = Log::ChannelFlag<4>,
LLVM_MARK_AS_BITMASK_ENUM(TypeCompletion)
};
-#define DWARF_LOG_DEBUG_INFO ::lldb_private::DWARFLog::DebugInfo
-#define DWARF_LOG_DEBUG_LINE ::lldb_private::DWARFLog::DebugLine
-#define DWARF_LOG_LOOKUPS ::lldb_private::DWARFLog::Lookups
-#define DWARF_LOG_TYPE_COMPLETION ::lldb_private::DWARFLog::TypeCompletion
-#define DWARF_LOG_DEBUG_MAP ::lldb_private::DWARFLog::DebugMap
class LogChannelDWARF {
public:
static void Initialize();
static void Terminate();
-
- static Log *GetLogIfAll(DWARFLog mask) { return GetLog(mask); }
- static Log *GetLogIfAny(DWARFLog mask) { return GetLog(mask); }
};
template <> Log::Channel &LogChannelFor<DWARFLog>();
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
index e15a22affcb2..e8fbd5dd664b 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -136,7 +136,7 @@ void ManualDWARFIndex::Index() {
void ManualDWARFIndex::IndexUnit(DWARFUnit &unit, SymbolFileDWARFDwo *dwp,
IndexSet &set) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS);
+ Log *log = GetLog(DWARFLog::Lookups);
if (log) {
m_module.LogMessage(
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 02d1a6a4a8be..027a4caf5555 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -138,7 +138,7 @@ static const llvm::DWARFDebugLine::LineTable *
ParseLLVMLineTable(lldb_private::DWARFContext &context,
llvm::DWARFDebugLine &line, dw_offset_t line_offset,
dw_offset_t unit_offset) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
llvm::DWARFDataExtractor data = context.getOrLoadLineData().GetAsLLVM();
llvm::DWARFContext &ctx = context.GetAsLLVM();
@@ -162,7 +162,7 @@ static bool ParseLLVMLineTablePrologue(lldb_private::DWARFContext &context,
llvm::DWARFDebugLine::Prologue &prologue,
dw_offset_t line_offset,
dw_offset_t unit_offset) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
bool success = true;
llvm::DWARFDataExtractor data = context.getOrLoadLineData().GetAsLLVM();
llvm::DWARFContext &ctx = context.GetAsLLVM();
@@ -443,7 +443,7 @@ SymbolFileDWARF::GetTypeSystemForLanguage(LanguageType language) {
}
void SymbolFileDWARF::InitializeObject() {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
InitializeFirstCodeAddress();
@@ -622,7 +622,7 @@ DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() {
auto abbr = std::make_unique<DWARFDebugAbbrev>();
llvm::Error error = abbr->parse(debug_abbrev_data);
if (error) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
LLDB_LOG_ERROR(log, std::move(error),
"Unable to read .debug_abbrev section: {0}");
return nullptr;
@@ -1030,7 +1030,7 @@ SymbolFileDWARF::GetTypeUnitSupportFiles(DWARFTypeUnit &tu) {
llvm::DWARFContext &ctx = m_context.GetAsLLVM();
llvm::DWARFDebugLine::Prologue prologue;
auto report = [](llvm::Error error) {
- Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
+ Log *log = GetLog(DWARFLog::DebugInfo);
LLDB_LOG_ERROR(log, std::move(error),
"SymbolFileDWARF::GetTypeUnitSupportFiles failed to parse "
"the line table prologue");
@@ -1488,7 +1488,7 @@ Type *SymbolFileDWARF::ResolveTypeUID(const DIERef &die_ref) {
Type *SymbolFileDWARF::ResolveTypeUID(const DWARFDIE &die,
bool assert_not_being_parsed) {
if (die) {
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
+ Log *log = GetLog(DWARFLog::DebugInfo);
if (log)
GetObjectFile()->GetModule()->LogMessage(
log, "SymbolFileDWARF::ResolveTypeUID (die = 0x%8.8x) %s '%s'",
@@ -1579,8 +1579,7 @@ bool SymbolFileDWARF::CompleteType(CompilerType &compiler_type) {
Type *type = GetDIEToType().lookup(dwarf_die.GetDIE());
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO |
- DWARF_LOG_TYPE_COMPLETION));
+ Log *log = GetLog(DWARFLog::DebugInfo | DWARFLog::TypeCompletion);
if (log)
GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(
log, "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...",
@@ -2109,7 +2108,7 @@ bool SymbolFileDWARF::DeclContextMatchesThisSymbolFile(
return true; // The type systems match, return true
// The namespace AST was valid, and it does not match...
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log)
GetObjectFile()->GetModule()->LogMessage(
@@ -2122,7 +2121,7 @@ void SymbolFileDWARF::FindGlobalVariables(
ConstString name, const CompilerDeclContext &parent_decl_ctx,
uint32_t max_matches, VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log)
GetObjectFile()->GetModule()->LogMessage(
@@ -2204,7 +2203,7 @@ void SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
uint32_t max_matches,
VariableList &variables) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log) {
GetObjectFile()->GetModule()->LogMessage(
@@ -2316,7 +2315,7 @@ void SymbolFileDWARF::FindFunctions(ConstString name,
// Module::LookupInfo::LookupInfo()
assert((name_type_mask & eFunctionNameTypeAuto) == 0);
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log) {
GetObjectFile()->GetModule()->LogMessage(
@@ -2366,7 +2365,7 @@ void SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
LLDB_SCOPED_TIMERF("SymbolFileDWARF::FindFunctions (regex = '%s')",
regex.GetText().str().c_str());
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log) {
GetObjectFile()->GetModule()->LogMessage(
@@ -2414,7 +2413,7 @@ void SymbolFileDWARF::FindTypes(
if (!searched_symbol_files.insert(this).second)
return;
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log) {
if (parent_decl_ctx)
@@ -2529,7 +2528,7 @@ CompilerDeclContext
SymbolFileDWARF::FindNamespace(ConstString name,
const CompilerDeclContext &parent_decl_ctx) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::Lookups);
if (log) {
GetObjectFile()->GetModule()->LogMessage(
@@ -2851,8 +2850,7 @@ TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
const dw_tag_t tag = dwarf_decl_ctx[0].tag;
if (type_name) {
- Log *log(LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
- DWARF_LOG_LOOKUPS));
+ Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
if (log) {
GetObjectFile()->GetModule()->LogMessage(
log,
diff --git a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 6ee189e04250..08bfe37fd92f 100644
--- a/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -61,7 +61,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
if (!oso_objfile)
return file_range_map;
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_MAP));
+ Log *log = GetLog(DWARFLog::DebugMap);
LLDB_LOGF(
log,
"%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')",
@@ -281,7 +281,7 @@ void SymbolFileDWARFDebugMap::InitOSO() {
Symtab *symtab = m_objfile_sp->GetSymtab();
if (symtab) {
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_MAP));
+ Log *log = GetLog(DWARFLog::DebugMap);
std::vector<uint32_t> oso_indexes;
// When a mach-o symbol is encoded, the n_type field is encoded in bits
diff --git a/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index c71a0120efde..2747e45756f0 100644
--- a/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -154,7 +154,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) {
[&decls, decl](const clang::CXXBaseSpecifier *specifier,
clang::CXXBasePath &path) {
if (auto *base_record = llvm::dyn_cast<clang::CXXRecordDecl>(
- specifier->getType()->getAs<clang::RecordType>()->getDecl())) {
+ specifier->getType()->castAs<clang::RecordType>()->getDecl())) {
clang::DeclarationName name = decl->getDeclName();
@@ -3175,7 +3175,7 @@ bool TypeSystemClang::IsBlockPointerType(
if (qual_type->isBlockPointerType()) {
if (function_pointer_type_ptr) {
const clang::BlockPointerType *block_pointer_type =
- qual_type->getAs<clang::BlockPointerType>();
+ qual_type->castAs<clang::BlockPointerType>();
QualType pointee_type = block_pointer_type->getPointeeType();
QualType function_pointer_type = m_ast_up->getPointerType(pointee_type);
*function_pointer_type_ptr =
@@ -3817,13 +3817,13 @@ TypeSystemClang::GetTypeInfo(lldb::opaque_compiler_type_t type,
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class) {
case clang::Type::Attributed:
- return GetTypeInfo(
- qual_type->getAs<clang::AttributedType>()
- ->getModifiedType().getAsOpaquePtr(),
- pointee_or_element_clang_type);
+ return GetTypeInfo(qual_type->castAs<clang::AttributedType>()
+ ->getModifiedType()
+ .getAsOpaquePtr(),
+ pointee_or_element_clang_type);
case clang::Type::Builtin: {
- const clang::BuiltinType *builtin_type = llvm::dyn_cast<clang::BuiltinType>(
- qual_type->getCanonicalTypeInternal());
+ const clang::BuiltinType *builtin_type =
+ llvm::cast<clang::BuiltinType>(qual_type->getCanonicalTypeInternal());
uint32_t builtin_type_flags = eTypeIsBuiltIn | eTypeHasValue;
switch (builtin_type->getKind()) {
@@ -4359,7 +4359,7 @@ TypeSystemClang::GetNumMemberFunctions(lldb::opaque_compiler_type_t type) {
case clang::Type::ObjCObjectPointer: {
const clang::ObjCObjectPointerType *objc_class_type =
- qual_type->getAs<clang::ObjCObjectPointerType>();
+ qual_type->castAs<clang::ObjCObjectPointerType>();
const clang::ObjCInterfaceType *objc_interface_type =
objc_class_type->getInterfaceType();
if (objc_interface_type &&
@@ -4443,7 +4443,7 @@ TypeSystemClang::GetMemberFunctionAtIndex(lldb::opaque_compiler_type_t type,
case clang::Type::ObjCObjectPointer: {
const clang::ObjCObjectPointerType *objc_class_type =
- qual_type->getAs<clang::ObjCObjectPointerType>();
+ qual_type->castAs<clang::ObjCObjectPointerType>();
const clang::ObjCInterfaceType *objc_interface_type =
objc_class_type->getInterfaceType();
if (objc_interface_type &&
@@ -5596,7 +5596,7 @@ uint32_t TypeSystemClang::GetNumFields(lldb::opaque_compiler_type_t type) {
case clang::Type::ObjCObjectPointer: {
const clang::ObjCObjectPointerType *objc_class_type =
- qual_type->getAs<clang::ObjCObjectPointerType>();
+ qual_type->castAs<clang::ObjCObjectPointerType>();
const clang::ObjCInterfaceType *objc_interface_type =
objc_class_type->getInterfaceType();
if (objc_interface_type &&
@@ -5745,7 +5745,7 @@ CompilerType TypeSystemClang::GetFieldAtIndex(lldb::opaque_compiler_type_t type,
case clang::Type::ObjCObjectPointer: {
const clang::ObjCObjectPointerType *objc_class_type =
- qual_type->getAs<clang::ObjCObjectPointerType>();
+ qual_type->castAs<clang::ObjCObjectPointerType>();
const clang::ObjCInterfaceType *objc_interface_type =
objc_class_type->getInterfaceType();
if (objc_interface_type &&
@@ -5882,7 +5882,7 @@ CompilerType TypeSystemClang::GetDirectBaseClassAtIndex(
const clang::CXXRecordDecl *base_class_decl =
llvm::cast<clang::CXXRecordDecl>(
base_class->getType()
- ->getAs<clang::RecordType>()
+ ->castAs<clang::RecordType>()
->getDecl());
if (base_class->isVirtual())
*bit_offset_ptr =
@@ -5977,7 +5977,7 @@ CompilerType TypeSystemClang::GetVirtualBaseClassAtIndex(
const clang::CXXRecordDecl *base_class_decl =
llvm::cast<clang::CXXRecordDecl>(
base_class->getType()
- ->getAs<clang::RecordType>()
+ ->castAs<clang::RecordType>()
->getDecl());
*bit_offset_ptr =
record_layout.getVBaseClassOffset(base_class_decl)
@@ -6732,7 +6732,7 @@ size_t TypeSystemClang::GetIndexOfChildMemberWithName(
child_indexes.push_back(child_idx);
parent_record_decl = llvm::cast<clang::RecordDecl>(
elem.Base->getType()
- ->getAs<clang::RecordType>()
+ ->castAs<clang::RecordType>()
->getDecl());
}
}
@@ -6925,7 +6925,7 @@ TypeSystemClang::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
clang::CXXRecordDecl *base_class_decl =
llvm::cast<clang::CXXRecordDecl>(
base_class->getType()
- ->getAs<clang::RecordType>()
+ ->castAs<clang::RecordType>()
->getDecl());
if (omit_empty_base_classes &&
!TypeSystemClang::RecordHasFields(base_class_decl))