Skip to content

Commit 4436761

Browse files
committed
LLDB linux updates
1 parent ca1b1f9 commit 4436761

5 files changed

Lines changed: 28 additions & 59 deletions

File tree

IDEHelper/CMakeLists.txt

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ file(GLOB SRC_FILES
122122
SpellChecker.cpp
123123
Targets.cpp
124124
X86XmmInfo.cpp
125+
LLDBDebugger.cpp
125126

126127
Beef/BfCommon.cpp
127128
Clang/CDepChecker.cpp
@@ -181,42 +182,24 @@ else()
181182
message(FATAL_ERROR "LLVM not found")
182183
endif()
183184

184-
set(DBG64_OBJECTS)
185-
186-
# Windows builds debugger backends through separate Debugger32/Debugger64
187-
# Visual Studio projects, with BF_DBG_32/BF_DBG_64 defined at the target
188-
# level; those Windows debugger backend targets are not currently modeled in
189-
# CMake. Do the same for Linux debugger sources here instead of compiling
190-
# them as part of the common IDEHelper source list.
191185
if(UNIX AND NOT APPLE)
192-
set(DBG64_SRC LinuxDebugger.cpp)
193186
find_path(LLDB_INCLUDE_DIR lldb/API/LLDB.h HINTS ${LLVM_INCLUDE_DIRS})
194187
find_library(LLDB_LIBRARY NAMES lldb liblldb lldb-22 liblldb-22 HINTS ${LLVM_LIBRARY_DIRS})
195188

196189
if (LLDB_INCLUDE_DIR AND LLDB_LIBRARY)
197190
message(STATUS "Found LLDB: ${LLDB_LIBRARY}")
198-
list(APPEND DBG64_SRC LLDBDebugger.cpp)
191+
add_definitions(-DLLDB_ENABLED)
199192
string(APPEND TARGET_LIBS_OS " ${LLDB_LIBRARY}")
200193
string(STRIP ${TARGET_LIBS_OS} TARGET_LIBS_OS)
201194
else()
202195
message(WARNING "LLDB was not found; Linux IDE debugger support will be disabled")
203196
endif()
204197

205-
add_library(IDEHelperDebugger64 OBJECT ${DBG64_SRC})
206-
target_compile_definitions(IDEHelperDebugger64 PRIVATE BF_DBG_64)
207-
if (LLDB_INCLUDE_DIR AND LLDB_LIBRARY)
208-
target_compile_definitions(IDEHelperDebugger64 PRIVATE LLDB_ENABLED)
209-
target_include_directories(IDEHelperDebugger64 PRIVATE ${LLDB_INCLUDE_DIR})
210-
endif()
211-
set(DBG64_OBJECTS $<TARGET_OBJECTS:IDEHelperDebugger64>)
212-
else()
213-
list(APPEND SRC_FILES LinuxDebugger.cpp)
214198
endif()
215199

216200
# Add library to build.
217201
add_library(${PROJECT_NAME} STATIC
218202
${SRC_FILES}
219-
${DBG64_OBJECTS}
220203
)
221204

222205
if (HAVE_BACKTRACE_HEADERS)

IDEHelper/LLDBDebugger.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,4 +2188,26 @@ bool LLDBDebugger::GetEmitSource(const StringImpl& filePath, String& outText)
21882188
return false;
21892189
}
21902190

2191+
#else
2192+
2193+
USING_NS_BF;
2194+
21912195
#endif
2196+
2197+
#ifndef BF_PLATFORM_WINDOWS
2198+
2199+
Beefy::Debugger* Beefy::CreateDebugger32(DebugManager* debugManager, DbgMiniDump* miniDump)
2200+
{
2201+
return NULL;
2202+
}
2203+
2204+
Beefy::Debugger* Beefy::CreateDebugger64(DebugManager* debugManager, DbgMiniDump* miniDump)
2205+
{
2206+
#ifdef LLDB_ENABLED
2207+
return new LLDBDebugger(debugManager);
2208+
#else
2209+
return NULL;
2210+
#endif
2211+
}
2212+
2213+
#endif

IDEHelper/LLDBDebugger.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#pragma once
22

3+
#if !defined BF_DBG_64 && !defined BF_DBG_32
4+
#define BF_DBG_64
5+
#endif
6+
37
#if defined BF_DBG_64 && defined BF_PLATFORM_WINDOWS
48
// Set LLDB_ENABLED below to test LLDB debugger on Windows
59
//#define LLDB_ENABLED

IDEHelper/LinuxDebugger.cpp

Lines changed: 0 additions & 32 deletions
This file was deleted.

IDEHelper/LinuxDebugger.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)