]> git.lizzy.rs Git - rust.git/commitdiff
Exec gdb and lldb in rust-* wrappers
authorftilde <ftilde@protonmail.com>
Sat, 18 Aug 2018 21:48:26 +0000 (23:48 +0200)
committerftilde <ftilde@protonmail.com>
Sat, 18 Aug 2018 22:00:00 +0000 (00:00 +0200)
This way the process we get by calling rust-{gdb,lldb} is an actual
{gdb,lldb} instance and not (perhaps surprisingly) a script waiting for
the debugger process to finish. Thus, sending a SIGINT to the spawned
process stops execution of the child, for example.

src/etc/rust-gdb
src/etc/rust-lldb

index 6835d6aa90874b7b7372dc8d68e557246a644696..743952a5bef89894134c7c785e11097dd2efe95d 100755 (executable)
@@ -20,7 +20,7 @@ GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
 # Set the environment variable `RUST_GDB` to overwrite the call to a
 # different/specific command (defaults to `gdb`).
 RUST_GDB="${RUST_GDB:-gdb}"
-PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" ${RUST_GDB} \
+PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
   --directory="$GDB_PYTHON_MODULE_DIRECTORY" \
   -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
   "$@"
index 56851595dd5ba824b7fb704f37e9e85c5f57a074..6a2849b55485e0ae05454ce93c96d6c518ab5bb5 100755 (executable)
@@ -32,7 +32,7 @@ category_definition="type summary add --no-value --python-function lldb_rust_for
 category_enable="type category enable Rust"
 
 # Call LLDB with the commands added to the argument list
-lldb --one-line-before-file="$script_import" \
+exec lldb --one-line-before-file="$script_import" \
     --one-line-before-file="$category_definition" \
     --one-line-before-file="$category_enable" \
     "$@"