Skip to content
Snippets Groups Projects
Commit 9e51da29 authored by Juntong Liu's avatar Juntong Liu
Browse files

Change to use option to pass options to debuggers

parent a208009c
No related branches found
No related tags found
No related merge requests found
......@@ -330,12 +330,30 @@ function loadFiles() {
EPICS_DRIVER_PATH="$add_path:$EPICS_DRIVER_PATH"
;;
-dg)
shift
__LOADER__="gdb --eval-command run --args "
if [[ -z "{2%--dgarg=*}" ]]; then
shift
if [[ -z "${1#*=}" ]]; then
__LOADER__="gdb --eval-command run --args "
else
__LOADER__="gdb ${1#*=} "
fi
else
printf "Wrong option format!"
help
fi
;;
-dv)
shift
__LOADER__="valgrind --leak-check=full "
if [[ -z "${2%--dvarg=*}" ]]; then
shift
if [[ -z "${1#*=}" ]]; then
__LOADER__="valgrind --leak-check=full "
else
__LOADER__="valgrind ${1#*=} "
fi
else
printf "Wrong option format!"
help
fi
;;
-n)
__LOADER__="nice --10 "
......@@ -344,7 +362,6 @@ function loadFiles() {
-*)
printf "Unknown option %s\n\n" "$1" >&2
help
exit 1
;;
*.so)
echo "dlload \"$file\""
......@@ -432,8 +449,8 @@ function help() {
printf " (Also -noinit, --noinit)\n"
printf " -r module[,ver] Module (optionally with version) loaded via 'require'.\n"
printf " -l 'cell path' Run Ioc with a cell path.\n"
printf " -dg Run with debugger gdb.\n"
printf " -dv Run with valgrind.\n"
printf " -dg --dgarg='gdb-options' Run with debugger gdb with user selected options.\n"
printf " -dv --dvarg='valgrind-options' Run with valgrind with user selected options.\n"
printf " -n Run with 'nice --10' (requires sudo).\n"
printf " @file More arguments are read from file.\n\n"
printf "Supported filetypes:\n\n"
......@@ -449,7 +466,11 @@ function help() {
printf " iocsh.bash my_database.template P=XY M=3\n"
printf " iocsh.bash -r my_module,version -c 'initModule()'\n"
printf " iocsh.bash -c 'var requireDebug 1' st.cmd\n"
printf " iocsh.bash -i st.cmd\n\n"
printf " iocsh.bash -i st.cmd\n"
printf " iocsh.bash -dv --dvarg='--vgdb=full'\n"
printf " --dvarg='' equal to --dvarg='--leak-check=full'\n"
printf " iocsh.bash -dg --dgarg='--return-child-result'\n"
printf " --dgarg='' equal to --dgarg='--eval-command run --args'\n\n"
} >&2
exit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment