File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -23,19 +23,16 @@ display the contents of local variables!"
23
23
echo " ***"
24
24
fi
25
25
26
- # Create a tempfile containing the LLDB script we want to execute on startup
27
- TMPFILE=` mktemp /tmp/rust-lldb-commands.XXXXXX`
28
-
29
- # Make sure to delete the tempfile no matter what
30
- trap " rm -f $TMPFILE ; exit" INT TERM EXIT
31
-
32
26
# Find out where to look for the pretty printer Python module
33
27
RUSTC_SYSROOT=` rustc --print sysroot`
34
28
35
- # Write the LLDB script to the tempfile
36
- echo " command script import \" $RUSTC_SYSROOT /lib/rustlib/etc/lldb_rust_formatters.py\" " >> $TMPFILE
37
- echo " type summary add --no-value --python-function lldb_rust_formatters.print_val -x \" .*\" --category Rust" >> $TMPFILE
38
- echo " type category enable Rust" >> $TMPFILE
29
+ # Prepare commands that will be loaded before any file on the command line has been loaded
30
+ script_import= " command script import \" $RUSTC_SYSROOT /lib/rustlib/etc/lldb_rust_formatters.py\" "
31
+ category_definition= " type summary add --no-value --python-function lldb_rust_formatters.print_val -x \" .*\" --category Rust"
32
+ category_enable= " type category enable Rust"
39
33
40
- # Call LLDB with the script added to the argument list
41
- lldb --source-before-file=" $TMPFILE " " $@ "
34
+ # Call LLDB with the commands added to the argument list
35
+ lldb --one-line-before-file=" $script_import " \
36
+ --one-line-before-file=" $category_definition " \
37
+ --one-line-before-file=" $category_enable " \
38
+ " $@ "
You can’t perform that action at this time.
0 commit comments