For our lldb customizations, instead of commenting out lines, use #ifdef

LLDB_ENABLE_ALL / #endif preprocess directives instead, so our diffs
against upstream only consist of added lines.
This commit is contained in:
Dimitry Andric 2017-12-24 13:39:32 +00:00
parent 54b4b13c4a
commit 0e56f9238c
4 changed files with 37 additions and 15 deletions

View File

@ -38,7 +38,9 @@
#include "lldb/lldb-enumerations.h"
class DWARFASTParserClang;
//class PDBASTParser;
#ifdef LLDB_ENABLE_ALL
class PDBASTParser;
#endif // LLDB_ENABLE_ALL
namespace lldb_private {
@ -425,7 +427,9 @@ class ClangASTContext : public TypeSystem {
// TypeSystem methods
//------------------------------------------------------------------
DWARFASTParser *GetDWARFParser() override;
//PDBASTParser *GetPDBParser();
#ifdef LLDB_ENABLE_ALL
PDBASTParser *GetPDBParser();
#endif // LLDB_ENABLE_ALL
//------------------------------------------------------------------
// ClangASTContext callbacks for external source lookups.
@ -997,7 +1001,9 @@ class ClangASTContext : public TypeSystem {
std::unique_ptr<clang::SelectorTable> m_selector_table_ap;
std::unique_ptr<clang::Builtin::Context> m_builtins_ap;
std::unique_ptr<DWARFASTParserClang> m_dwarf_ast_parser_ap;
// std::unique_ptr<PDBASTParser> m_pdb_ast_parser_ap;
#ifdef LLDB_ENABLE_ALL
std::unique_ptr<PDBASTParser> m_pdb_ast_parser_ap;
#endif // LLDB_ENABLE_ALL
std::unique_ptr<ClangASTSource> m_scratch_ast_source_ap;
std::unique_ptr<clang::MangleContext> m_mangle_ctx_ap;
CompleteTagDeclCallback m_callback_tag_decl;

View File

@ -13,9 +13,13 @@
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
//#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
#ifdef LLDB_ENABLE_ALL
#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
#endif // LLDB_ENABLE_ALL
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
//#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
#ifdef LLDB_ENABLE_ALL
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
#endif // LLDB_ENABLE_ALL
#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
@ -82,7 +86,9 @@ void SystemInitializerCommon::Initialize() {
// Initialize plug-ins
ObjectContainerBSDArchive::Initialize();
ObjectFileELF::Initialize();
//ObjectFilePECOFF::Initialize();
#ifdef LLDB_ENABLE_ALL
ObjectFilePECOFF::Initialize();
#endif // LLDB_ENABLE_ALL
EmulateInstructionARM::Initialize();
EmulateInstructionMIPS::Initialize();
@ -91,7 +97,9 @@ void SystemInitializerCommon::Initialize() {
//----------------------------------------------------------------------
// Apple/Darwin hosted plugins
//----------------------------------------------------------------------
//ObjectContainerUniversalMachO::Initialize();
#ifdef LLDB_ENABLE_ALL
ObjectContainerUniversalMachO::Initialize();
#endif // LLDB_ENABLE_ALL
#if defined(__APPLE__)
ObjectFileMachO::Initialize();
@ -109,13 +117,17 @@ void SystemInitializerCommon::Terminate() {
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
ObjectContainerBSDArchive::Terminate();
ObjectFileELF::Terminate();
//ObjectFilePECOFF::Terminate();
#ifdef LLDB_ENABLE_ALL
ObjectFilePECOFF::Terminate();
#endif // LLDB_ENABLE_ALL
EmulateInstructionARM::Terminate();
EmulateInstructionMIPS::Terminate();
EmulateInstructionMIPS64::Terminate();
//ObjectContainerUniversalMachO::Terminate();
#ifdef LLDB_ENABLE_ALL
ObjectContainerUniversalMachO::Terminate();
#endif // LLDB_ENABLE_ALL
#if defined(__APPLE__)
ObjectFileMachO::Terminate();
#endif

View File

@ -70,7 +70,9 @@
// Project includes
#include "GDBRemoteRegisterContext.h"
//#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
#ifdef LLDB_ENABLE_ALL
#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
#endif // LLDB_ENABLE_ALL
#include "Plugins/Process/Utility/GDBRemoteSignals.h"
#include "Plugins/Process/Utility/InferiorCallPOSIX.h"
#include "Plugins/Process/Utility/StopInfoMachException.h"
@ -2474,7 +2476,7 @@ Status ProcessGDBRemote::DoDestroy() {
if (log)
log->Printf("ProcessGDBRemote::DoDestroy()");
#if 0 // XXX Currently no iOS target support on FreeBSD
#ifdef LLDB_ENABLE_ALL // XXX Currently no iOS target support on FreeBSD
// There is a bug in older iOS debugservers where they don't shut down the
// process
// they are debugging properly. If the process is sitting at a breakpoint or
@ -2587,7 +2589,7 @@ Status ProcessGDBRemote::DoDestroy() {
}
}
}
#endif
#endif // LLDB_ENABLE_ALL
// Interrupt if our inferior is running...
int exit_status = SIGABRT;

View File

@ -99,7 +99,9 @@
#include "lldb/Utility/RegularExpression.h"
#include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
//#include "Plugins/SymbolFile/PDB/PDBASTParser.h"
#ifdef LLDB_ENABLE_ALL
#include "Plugins/SymbolFile/PDB/PDBASTParser.h"
#endif // LLDB_ENABLE_ALL
#include <stdio.h>
@ -9603,13 +9605,13 @@ DWARFASTParser *ClangASTContext::GetDWARFParser() {
return m_dwarf_ast_parser_ap.get();
}
#if 0
#ifdef LLDB_ENABLE_ALL
PDBASTParser *ClangASTContext::GetPDBParser() {
if (!m_pdb_ast_parser_ap)
m_pdb_ast_parser_ap.reset(new PDBASTParser(*this));
return m_pdb_ast_parser_ap.get();
}
#endif
#endif // LLDB_ENABLE_ALL
bool ClangASTContext::LayoutRecordType(
void *baton, const clang::RecordDecl *record_decl, uint64_t &bit_size,