mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +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: https://github.com/LadybirdBrowser/ladybird/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
|
||||
)
|
||||
|
||||
add_custom_target(debug-ladybird
|
||||
COMMAND "${CMAKE_COMMAND}" -E env "LADYBIRD_SOURCE_DIR=${LADYBIRD_SOURCE_DIR}" gdb -ex "set follow-fork-mode child" "$<TARGET_FILE:ladybird>"
|
||||
USES_TERMINAL
|
||||
)
|
||||
if (APPLE)
|
||||
add_custom_target(debug-ladybird
|
||||
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(RequestServer)
|
||||
|
|
|
@ -142,6 +142,14 @@ run_gdb() {
|
|||
local GDB_ARGS=()
|
||||
local PASS_ARG_TO_GDB=""
|
||||
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
|
||||
if [ "$PASS_ARG_TO_GDB" != "" ]; then
|
||||
GDB_ARGS+=( "$PASS_ARG_TO_GDB" "$arg" )
|
||||
|
@ -168,7 +176,7 @@ run_gdb() {
|
|||
LAGOM_EXECUTABLE="Ladybird"
|
||||
fi
|
||||
fi
|
||||
gdb "$BUILD_DIR/bin/$LAGOM_EXECUTABLE" "${GDB_ARGS[@]}"
|
||||
"$GDB" "$BUILD_DIR/bin/$LAGOM_EXECUTABLE" "${GDB_ARGS[@]}"
|
||||
}
|
||||
|
||||
build_and_run_lagom_target() {
|
||||
|
|
Loading…
Reference in a new issue