+2019-10-02 Arjun Shankar <arjun@redhat.com>
+
+ debugglibc.sh: Implement program arguments
+ * Makefile (debugglibc): Change variable definition.
+
2019-10-01 Alistair Francis <alistair.francis@wdc.com>
* time/bits/types/struct_timespec.h: Add padding for the timespec if
usage()
{
cat << EOF
-Usage: $$0 [OPTIONS] <testcase>
+Usage: $$0 [OPTIONS] <program>
- where <testcase> is the path to the program being tested.
+ Or: $$0 [OPTIONS] -- <program> [<args>]...
+
+ where <program> is the path to the program being tested,
+ and <args> are the arguments to be passed to it.
Options:
The following options do not take arguments:
-i, --no-direct
- Selects whether to pass the flag --direct to gdb.
- Required for glibc test cases and not allowed for non-glibc tests.
- Default behaviour is to pass the flag --direct to gdb.
+ Selects whether to pass the --direct flag to the program.
+ --direct is useful when debugging glibc test cases. It inhibits the
+ tests from forking and executing in a subprocess.
+ Default behaviour is to pass the --direct flag, except when the
+ program is run with user specified arguments using the "--" separator.
-s, --no-symbols-file
- Do not tell GDB to load debug symbols from the testcase.
+ Do not tell GDB to load debug symbols from the program.
EOF
}
-s|--no-symbols-file)
SYMBOLSFILE=false
;;
+ --)
+ shift
+ TESTCASE=$$1
+ COMMANDLINE="$$@"
+ # Don't add --direct when user specifies program arguments
+ DIRECT=false
+ break
+ ;;
*)
TESTCASE=$$1
+ COMMANDLINE=$$TESTCASE
;;
esac
shift
__SYMBOLSFILE__
break _dl_start_user
run --library-path $(rpath-link):$${BUILD_DIR}/nptl_db \
-__TESTCASE__ __DIRECT__
+__COMMANDLINE__ __DIRECT__
__BREAKPOINTS__
EOF
}
template | sed \
-e "s|__ENVVARS__|$$ENVVARSCMD|" \
-e "s|__SYMBOLSFILE__|$$SYMBOLSFILE|" \
- -e "s|__TESTCASE__|$$TESTCASE|" \
+ -e "s|__COMMANDLINE__|$$COMMANDLINE|" \
-e "s|__DIRECT__|$$DIRECT|" \
-e "s|__BREAKPOINTS__|$$BREAKPOINTS|" \
> $$CMD_FILE