+prefix=core
+
+# When the -a option is present, this may hold additional commands
+# to ensure gdb dumps all mappings (OS dependent).
+dump_all_cmds=()
+
+while getopts :ao: opt; do
+ case "$opt" in
+ a)
+ case "$OSTYPE" in
+ linux*)
+ dump_all_cmds=("-ex" "set use-coredump-filter off")
+ dump_all_cmds+=("-ex" "set dump-excluded-mappings on")
+ ;;
+ esac
+ ;;
+ o)
+ prefix=$OPTARG
+ ;;
+ *)
+ echo "usage: @GCORE_TRANSFORM_NAME@ [-a] [-o prefix] pid1 [pid2...pidN]"
+ exit 2
+ ;;
+ esac
+done
+
+shift $((OPTIND-1))