mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Meta+CMake: Use lldb on macOS for debugging
This commit is contained in:
committed by
Andrew Kaster
parent
72b4d44d07
commit
3cdd4fb769
@@ -107,10 +107,17 @@ add_custom_target(run
|
|||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(debug-ladybird
|
if (APPLE)
|
||||||
COMMAND "${CMAKE_COMMAND}" -E env "LADYBIRD_SOURCE_DIR=${LADYBIRD_SOURCE_DIR}" gdb -ex "set follow-fork-mode child" "$<TARGET_FILE:ladybird>"
|
add_custom_target(debug-ladybird
|
||||||
USES_TERMINAL
|
COMMAND "${CMAKE_COMMAND}" -E env "LADYBIRD_SOURCE_DIR=${LADYBIRD_SOURCE_DIR}" lldb "$<TARGET_BUNDLE_DIR:ladybird>"
|
||||||
)
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_target(debug-ladybird
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E env "LADYBIRD_SOURCE_DIR=${LADYBIRD_SOURCE_DIR}" gdb "$<TARGET_FILE:ladybird>"
|
||||||
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(ImageDecoder)
|
add_subdirectory(ImageDecoder)
|
||||||
add_subdirectory(RequestServer)
|
add_subdirectory(RequestServer)
|
||||||
|
|||||||
@@ -142,6 +142,14 @@ run_gdb() {
|
|||||||
local GDB_ARGS=()
|
local GDB_ARGS=()
|
||||||
local PASS_ARG_TO_GDB=""
|
local PASS_ARG_TO_GDB=""
|
||||||
local LAGOM_EXECUTABLE=""
|
local LAGOM_EXECUTABLE=""
|
||||||
|
local GDB=gdb
|
||||||
|
if ! command -v "$GDB" > /dev/null 2>&1; then
|
||||||
|
GDB=lldb
|
||||||
|
if ! command -v "$GDB" > /dev/null 2>&1; then
|
||||||
|
die "Please install gdb or lldb!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
for arg in "${CMD_ARGS[@]}"; do
|
for arg in "${CMD_ARGS[@]}"; do
|
||||||
if [ "$PASS_ARG_TO_GDB" != "" ]; then
|
if [ "$PASS_ARG_TO_GDB" != "" ]; then
|
||||||
GDB_ARGS+=( "$PASS_ARG_TO_GDB" "$arg" )
|
GDB_ARGS+=( "$PASS_ARG_TO_GDB" "$arg" )
|
||||||
@@ -168,7 +176,7 @@ run_gdb() {
|
|||||||
LAGOM_EXECUTABLE="Ladybird"
|
LAGOM_EXECUTABLE="Ladybird"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
gdb "$BUILD_DIR/bin/$LAGOM_EXECUTABLE" "${GDB_ARGS[@]}"
|
"$GDB" "$BUILD_DIR/bin/$LAGOM_EXECUTABLE" "${GDB_ARGS[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_and_run_lagom_target() {
|
build_and_run_lagom_target() {
|
||||||
|
|||||||
Reference in New Issue
Block a user