From c4409d2fd5ef27532dfebcb090691efddcd4469e Mon Sep 17 00:00:00 2001 From: Aditya Mandaleeka Date: Thu, 18 Aug 2016 18:13:52 -0700 Subject: [PATCH] Print info from core dumps on OS X using LLDB. Commit migrated from https://github.com/dotnet/coreclr/commit/60b9b8d9a774fba6ba45aa6d141fb60be19de5ad --- src/coreclr/tests/runtest.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/coreclr/tests/runtest.sh b/src/coreclr/tests/runtest.sh index c75c1b9..9368663 100755 --- a/src/coreclr/tests/runtest.sh +++ b/src/coreclr/tests/runtest.sh @@ -576,14 +576,19 @@ function print_info_from_core_file { return fi - # Check for the existence of GDB on the path - hash gdb 2>/dev/null || { echo >&2 "GDB was not found. Unable to print core file."; return; } + # Use LLDB to inspect the core dump on Mac, and GDB everywhere else. + if [[ "$OSName" == "Darwin" ]]; then + hash lldb 2>/dev/null || { echo >&2 "LLDB was not found. Unable to print core file."; return; } - echo "Printing info from core file $core_file_name" + echo "Printing info from core file $core_file_name" + lldb -c $core_file_name -b -o 'bt' + else + # Use GDB to print the backtrace from the core file. + hash gdb 2>/dev/null || { echo >&2 "GDB was not found. Unable to print core file."; return; } - # Open the dump in GDB and print the stack from each thread. We can add more - # commands here if desired. - gdb --batch -ex "thread apply all bt full" -ex "quit" $executable_name $core_file_name + echo "Printing info from core file $core_file_name" + gdb --batch -ex "thread apply all bt full" -ex "quit" $executable_name $core_file_name + fi } function download_dumpling_script { -- 2.7.4