mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-27 11:48:59 +00:00
Meta+CMake: Use lldb on macOS for debugging
This commit is contained in:
parent
72b4d44d07
commit
3cdd4fb769
Notes:
sideshowbarker
2024-07-16 17:12:03 +09:00
Author: https://github.com/ADKaster
Commit: 3cdd4fb769
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/317
Reviewed-by: https://github.com/trflynn89
2 changed files with 20 additions and 5 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue