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

Merge branch 'E3-531_pass_options2debuggers' into 'master'

E3-531: Add argument to pass options to debuggers

See merge request e3/e3-require!50
parents a208009c 3bbfde02
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### New Features ### New Features
* Arguments have been added to `iocsh.bash` to enable user to pass any debugger options to GDB and Valgrind.
* Autocompletion for `iocsh.bash` has been added * Autocompletion for `iocsh.bash` has been added
* Removed `iocsh_gdb.bash` and `iocsh_nice.bash`, both of whose functionality can be called via `iocsh.bash -dg` and `iocsh.bash -n`, respectively. * Removed `iocsh_gdb.bash` and `iocsh_nice.bash`, both of whose functionality can be called via `iocsh.bash -dg` and `iocsh.bash -n`, respectively.
* Patch file location has been change from `patch/Site/$VERSION-description.p0.patch` to `patch/Site/$VERSION/description.p0.patch` * Patch file location has been change from `patch/Site/$VERSION-description.p0.patch` to `patch/Site/$VERSION/description.p0.patch`
......
...@@ -330,12 +330,28 @@ function loadFiles() { ...@@ -330,12 +330,28 @@ function loadFiles() {
EPICS_DRIVER_PATH="$add_path:$EPICS_DRIVER_PATH" EPICS_DRIVER_PATH="$add_path:$EPICS_DRIVER_PATH"
;; ;;
-dg) -dg)
shift if [[ -n "${2%--dgarg=*}" ]]; then
__LOADER__="gdb --eval-command run --args " __LOADER__="gdb --eval-command run --args "
else
shift
if [[ -z "${1#*=}" ]]; then
__LOADER__="gdb "
else
__LOADER__="gdb ${1#*=} "
fi
fi
;; ;;
-dv) -dv)
shift if [[ -n "${2%--dvarg=*}" ]]; then
__LOADER__="valgrind --leak-check=full " __LOADER__="valgrind --leak-check=full "
else
shift
if [[ -z "${1#*=}" ]]; then
__LOADER__="valgrind "
else
__LOADER__="valgrind ${1#*=} "
fi
fi
;; ;;
-n) -n)
__LOADER__="nice --10 " __LOADER__="nice --10 "
...@@ -344,7 +360,6 @@ function loadFiles() { ...@@ -344,7 +360,6 @@ function loadFiles() {
-*) -*)
printf "Unknown option %s\n\n" "$1" >&2 printf "Unknown option %s\n\n" "$1" >&2
help help
exit 1
;; ;;
*.so) *.so)
echo "dlload \"$file\"" echo "dlload \"$file\""
...@@ -432,8 +447,8 @@ function help() { ...@@ -432,8 +447,8 @@ function help() {
printf " (Also -noinit, --noinit)\n" printf " (Also -noinit, --noinit)\n"
printf " -r module[,ver] Module (optionally with version) loaded via 'require'.\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 " -l 'cell path' Run Ioc with a cell path.\n"
printf " -dg Run with debugger gdb.\n" printf " -dg [--dgarg='gdb-options'] Run with debugger gdb with user selected options or default option.\n"
printf " -dv Run with valgrind.\n" printf " -dv [--dvarg='valgrind-options'] Run with valgrind with user selected options or default option.\n"
printf " -n Run with 'nice --10' (requires sudo).\n" printf " -n Run with 'nice --10' (requires sudo).\n"
printf " @file More arguments are read from file.\n\n" printf " @file More arguments are read from file.\n\n"
printf "Supported filetypes:\n\n" printf "Supported filetypes:\n\n"
...@@ -449,8 +464,9 @@ function help() { ...@@ -449,8 +464,9 @@ function help() {
printf " iocsh.bash my_database.template P=XY M=3\n" printf " iocsh.bash my_database.template P=XY M=3\n"
printf " iocsh.bash -r my_module,version -c 'initModule()'\n" printf " iocsh.bash -r my_module,version -c 'initModule()'\n"
printf " iocsh.bash -c 'var requireDebug 1' st.cmd\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 " iocsh.bash -dv st.cmd\n\n"
} >&2 } >&2
exit 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