-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathdump_asm.sh
More file actions
executable file
·29 lines (23 loc) · 671 Bytes
/
dump_asm.sh
File metadata and controls
executable file
·29 lines (23 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
cd "$(dirname "$(realpath "$0")")"
if ! command -v rustfilt &> /dev/null
then
cargo install rustfilt
fi
rm -rf ./target
cargo rustc --release -- --emit asm -C "llvm-args=-x86-asm-syntax=intel"
cat ./target/release/deps/gdbstub_nostd-*.s | rustfilt > asm.s
sed -i -E '/\.(cfi_def_cfa_offset|cfi_offset|cfi_startproc|cfi_endproc|size)/d' asm.s
if [ -n "$EXTRA_TRIM" ]; then
sed -i -E '/\.(Ltmp|file|loc)/d' asm.s
sed -i -E '/.section\t.debug_loc/,$d' asm.s
fi
echo "asm emitted to asm.s"
if grep "core::panicking::panic_fmt" asm.s
then
echo "found panic in example_no_std!"
exit 1
else
echo "no panics in example_no_std"
fi