Skip to content

Commit

Permalink
Exec gdb and lldb in rust-* wrappers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ftilde committed Aug 18, 2018
1 parent 73b5c7e commit d6426e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/etc/rust-gdb
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
"$@"
2 changes: 1 addition & 1 deletion src/etc/rust-lldb
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
"$@"

0 comments on commit d6426e8

Please sign in to comment.