The gdb and valgrind launchers previously passed every argument straight to magic, leaving no way to give the tool its own options. Add a "--" split (shared magic_split_args helper): arguments before "--" go to gdb/valgrind, arguments after go to magic; with no "--", all arguments go to magic (the common case). Examples: ./run_magic_gdb.sh -tui -ex run -- -dnull foo.mag ./run_magic_valgrind.sh --tool=callgrind -- foo.mag Also make the tool binary and its default options overridable from the environment: GDB/GDB_OPTS and VALGRIND/VALGRIND_OPTS (valgrind defaults to --leak-check=full --error-exitcode=0), and warn if the tool is not on PATH. Smoke-tested against a live X display: gdb runs magic to a clean exit and valgrind produces a Memcheck report; option routing verified (a bogus flag after "--" is rejected by magic, not gdb), both headless (-dnull) and GUI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| config.guess | ||
| config.sub | ||
| configure | ||
| configure.in | ||
| configure_mac | ||
| defs.mak.in | ||
| install-sh | ||
| magic.spec.in | ||
| magic_run_common.sh.in | ||
| makedbh.in | ||
| missing | ||
| mkdirs | ||
| mkinstalldirs | ||
| preproc.py | ||
| printmans | ||
| run_magic.sh.in | ||
| run_magic_gdb.sh.in | ||
| run_magic_valgrind.sh.in | ||
| run_magicnull.sh.in | ||