From 7e42bbed5b11c30330b722d78eec3b2004f1a918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= Date: Fri, 2 Feb 2024 11:13:47 +0100 Subject: Add a test for the gcore script It also tests the gcore script being run without its accessible terminal. This test was written by Jan Kratochvil a long time ago. I modernized the test making it use various procs from lib/gdb.exp, reorganizing it and added some comments. Modify the gcore script to make it possible to pass the --data-directory to it. This prevents a lot of these warnings: Python Exception : module 'gdb' has no attribute '_handle_missing_debuginfo' Tested by using make check-all-boards. Co-Authored-By: Jan Kratochvil Reviewed-By: Eli Zaretskii --- gdb/gcore.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gdb/gcore.in') diff --git a/gdb/gcore.in b/gdb/gcore.in index 982c854..0c40e5a 100644 --- a/gdb/gcore.in +++ b/gdb/gcore.in @@ -27,7 +27,9 @@ prefix=core # to ensure gdb dumps all mappings (OS dependent). dump_all_cmds=() -while getopts :ao: opt; do +data_directory_opt=() + +while getopts :ao:d: opt; do case "$opt" in a) case "$OSTYPE" in @@ -40,8 +42,11 @@ while getopts :ao: opt; do o) prefix=$OPTARG ;; + d) + data_directory_opt=("--data-directory" "$OPTARG") + ;; *) - echo "usage: @GCORE_TRANSFORM_NAME@ [-a] [-o prefix] pid1 [pid2...pidN]" + echo "usage: @GCORE_TRANSFORM_NAME@ [-a] [-o prefix] [-d data-directory] pid1 [pid2...pidN]" exit 2 ;; esac @@ -51,7 +56,7 @@ shift $((OPTIND-1)) if [ "$#" -eq "0" ] then - echo "usage: @GCORE_TRANSFORM_NAME@ [-a] [-o prefix] pid1 [pid2...pidN]" + echo "usage: @GCORE_TRANSFORM_NAME@ [-a] [-o prefix] [-d data-directory] pid1 [pid2...pidN]" exit 2 fi @@ -98,6 +103,7 @@ do # `