Skip to content

Commit

Permalink
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Browse files Browse the repository at this point in the history
Most of our code was including Log.h even though that is not where the
"lldb" log channel is defined (Log.h defines the generic logging
infrastructure). This worked because Log.h included Logging.h, even
though it should.

After the recent refactor, it became impossible the two files include
each other in this direction (the opposite inclusion is needed), so this
patch removes the workaround that was put in place and cleans up all
files to include the right thing. It also renames the file to LLDBLog to
better reflect its purpose.
  • Loading branch information
labath committed Feb 3, 2022
1 parent 1c6dca9 commit c34698a
Show file tree
Hide file tree
Showing 228 changed files with 240 additions and 85 deletions.
2 changes: 1 addition & 1 deletion lldb/include/lldb/Interpreter/ScriptedInterface.h
Expand Up @@ -11,8 +11,8 @@

#include "lldb/Core/StructuredDataImpl.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/lldb-private.h"

#include "llvm/Support/Compiler.h"
Expand Down
2 changes: 0 additions & 2 deletions lldb/include/lldb/Utility/Instrumentation.h
Expand Up @@ -10,8 +10,6 @@

#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
Expand Down
@@ -1,13 +1,13 @@
//===-- Logging.h -----------------------------------------------*- C++ -*-===//
//===-- LLDBLog.h -----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_UTILITY_LOGGING_H
#define LLDB_UTILITY_LOGGING_H
#ifndef LLDB_UTILITY_LLDBLOG_H
#define LLDB_UTILITY_LLDBLOG_H

#include "lldb/Utility/Log.h"
#include "llvm/ADT/BitmaskEnum.h"
Expand Down Expand Up @@ -57,4 +57,4 @@ void InitializeLldbChannel();
template <> Log::Channel &LogChannelFor<LLDBLog>();
} // namespace lldb_private

#endif // LLDB_UTILITY_LOGGING_H
#endif // LLDB_UTILITY_LLDBLOG_H
3 changes: 0 additions & 3 deletions lldb/include/lldb/Utility/Log.h
Expand Up @@ -117,8 +117,6 @@ class Log final {
};


static void Initialize();

// Static accessors for logging channels
static void Register(llvm::StringRef name, Channel &channel);
static void Unregister(llvm::StringRef name);
Expand Down Expand Up @@ -310,4 +308,3 @@ template <typename Cat> Log *GetLog(Cat mask) {
#endif // LLDB_UTILITY_LOG_H

// TODO: Remove this and fix includes everywhere.
#include "lldb/Utility/Logging.h"
4 changes: 2 additions & 2 deletions lldb/source/API/SBDebugger.cpp
Expand Up @@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//

#include "lldb/API/SBDebugger.h"
#include "SystemInitializerFull.h"
#include "lldb/Utility/Instrumentation.h"

#include "lldb/API/SBDebugger.h"
#include "lldb/Utility/LLDBLog.h"

#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBCommandInterpreter.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/API/SBFrame.cpp
Expand Up @@ -38,6 +38,7 @@
#include "lldb/Target/Thread.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Instrumentation.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Stream.h"

#include "lldb/API/SBAddress.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/API/SBStream.cpp
Expand Up @@ -12,6 +12,7 @@
#include "lldb/Core/StreamFile.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Utility/Instrumentation.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBTarget.cpp
Expand Up @@ -8,7 +8,7 @@

#include "lldb/API/SBTarget.h"
#include "lldb/Utility/Instrumentation.h"

#include "lldb/Utility/LLDBLog.h"
#include "lldb/lldb-public.h"

#include "lldb/API/SBBreakpoint.h"
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Breakpoint/Breakpoint.cpp
Expand Up @@ -19,13 +19,14 @@
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Core/Section.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Breakpoint/BreakpointLocation.cpp
Expand Up @@ -22,6 +22,7 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Breakpoint/BreakpointResolver.cpp
Expand Up @@ -24,6 +24,7 @@
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
Expand Down
4 changes: 1 addition & 3 deletions lldb/source/Breakpoint/BreakpointResolverAddress.cpp
Expand Up @@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//

#include "lldb/Breakpoint/BreakpointResolverAddress.h"


#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/StreamString.h"

using namespace lldb;
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
Expand Up @@ -12,6 +12,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"

Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Breakpoint/BreakpointResolverName.cpp
Expand Up @@ -15,8 +15,9 @@
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Breakpoint/Watchpoint.cpp
Expand Up @@ -17,6 +17,7 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Commands/CommandObjectTarget.cpp
Expand Up @@ -47,6 +47,7 @@
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/Timer.h"

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/AddressResolverFileLine.cpp
Expand Up @@ -14,8 +14,8 @@
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/lldb-enumerations.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/Communication.cpp
Expand Up @@ -13,9 +13,9 @@
#include "lldb/Utility/Connection.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Event.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Listener.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/Status.h"

#include "llvm/ADT/None.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/DataFileCache.cpp
Expand Up @@ -12,8 +12,8 @@
#include "lldb/Host/FileSystem.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "llvm/Support/CachePruning.h"
#include "llvm/Support/MemoryBuffer.h"

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Core/Debugger.cpp
Expand Up @@ -43,6 +43,7 @@
#include "lldb/Target/ThreadList.h"
#include "lldb/Utility/AnsiTerminal.h"
#include "lldb/Utility/Event.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Listener.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Reproducer.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/FormatEntity.cpp
Expand Up @@ -44,8 +44,8 @@
#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/Mangled.cpp
Expand Up @@ -13,8 +13,8 @@
#include "lldb/Target/Language.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Stream.h"
#include "lldb/lldb-enumerations.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/Module.cpp
Expand Up @@ -39,8 +39,8 @@
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ModuleList.cpp
Expand Up @@ -22,8 +22,8 @@
#include "lldb/Symbol/VariableList.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/UUID.h"
#include "lldb/lldb-defines.h"

Expand Down
5 changes: 1 addition & 4 deletions lldb/source/Core/RichManglingContext.cpp
Expand Up @@ -7,11 +7,8 @@
//===----------------------------------------------------------------------===//

#include "lldb/Core/RichManglingContext.h"

#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"

#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "lldb/Utility/LLDBLog.h"

#include "llvm/ADT/StringRef.h"

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Core/StreamFile.cpp
Expand Up @@ -8,6 +8,7 @@

#include "lldb/Core/StreamFile.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"

#include <cstdio>
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObject.cpp
Expand Up @@ -42,8 +42,8 @@
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Flags.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObjectDynamicValue.cpp
Expand Up @@ -16,8 +16,8 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-types.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Core/ValueObjectRegister.cpp
Expand Up @@ -18,6 +18,7 @@
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Status.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObjectSyntheticFilter.cpp
Expand Up @@ -12,8 +12,8 @@
#include "lldb/Core/ValueObject.h"
#include "lldb/DataFormatters/TypeSynthetic.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/Status.h"

#include "llvm/ADT/STLExtras.h"
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/DataFormatters/FormatManager.cpp
Expand Up @@ -8,15 +8,14 @@

#include "lldb/DataFormatters/FormatManager.h"

#include "llvm/ADT/STLExtras.h"


#include "lldb/Core/Debugger.h"
#include "lldb/DataFormatters/FormattersHelpers.h"
#include "lldb/DataFormatters/LanguageCategory.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Language.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "llvm/ADT/STLExtras.h"

using namespace lldb;
using namespace lldb_private;
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/DataFormatters/TypeCategoryMap.cpp
Expand Up @@ -9,9 +9,9 @@
#include "lldb/DataFormatters/TypeCategoryMap.h"

#include "lldb/DataFormatters/FormatClasses.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"


using namespace lldb;
using namespace lldb_private;

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/DWARFExpression.cpp
Expand Up @@ -16,6 +16,7 @@
#include "lldb/Core/Value.h"
#include "lldb/Core/dwarf.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Scalar.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/ExpressionVariable.cpp
Expand Up @@ -9,6 +9,7 @@
#include "lldb/Expression/ExpressionVariable.h"
#include "lldb/Expression/IRExecutionUnit.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"

using namespace lldb_private;
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/FunctionCaller.cpp
Expand Up @@ -24,6 +24,7 @@
#include "lldb/Target/ThreadPlan.h"
#include "lldb/Target/ThreadPlanCallFunction.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/State.h"

Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/IRExecutionUnit.cpp
Expand Up @@ -32,6 +32,7 @@
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"

#include "lldb/../../source/Plugins/ObjectFile/JIT/ObjectFileJIT.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/IRInterpreter.cpp
Expand Up @@ -16,6 +16,7 @@
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Status.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/IRMemoryMap.cpp
Expand Up @@ -13,6 +13,7 @@
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Status.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Expression/LLVMUserExpression.cpp
Expand Up @@ -30,6 +30,7 @@
#include "lldb/Target/ThreadPlan.h"
#include "lldb/Target/ThreadPlanCallUserExpression.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"

Expand Down

0 comments on commit c34698a

Please sign in to comment.