File tree Expand file tree Collapse file tree 2 files changed +32
-9
lines changed Expand file tree Collapse file tree 2 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -134,16 +134,35 @@ main() {
134134 # # Logging with symbols
135135 pushd logging
136136
137- # check that the output and disassembly matches
137+ # check that the ~output~ and disassembly matches
138+ # the output won't exactly match because addresses of static variables won't
139+ # remain the same when the toolchain is updated. Instead we'll that the
140+ # printed address is contained in the output of `cargo objdump -- -t`
138141 pushd app
139- diff dev.out \
140- <( cargo run)
141- diff dev.objdump \
142- <( cargo objdump --bin app -- -t | grep ' \.rodata\s*0*1\b' )
143- diff release.out \
144- <( cargo run --release)
145- diff release.objdump \
146- <( cargo objdump --bin app --release -- -t | grep ' \.rodata\s*0*1\b' )
142+ cargo run > dev.out
143+ cargo objdump --bin app -- -t | grep ' \.rodata\s*0*1\b' > dev.objdump
144+ for address in $( cat dev.out) ; do
145+ grep ${address# 0x} dev.objdump
146+ done
147+
148+ cargo run --release > release.out
149+ cargo objdump --bin app --release -- -t | grep ' \.rodata\s*0*1\b' > dev.objdump
150+ for address in $( cat release.out) ; do
151+ grep ${address# 0x} release.objdump
152+ done
153+
154+ # sanity check the committed files
155+ git checkout dev.out
156+ git checkout dev.objdump
157+ for address in $( cat dev.out) ; do
158+ grep ${address# 0x} dev.objdump
159+ done
160+
161+ git checkout release.out
162+ git checkout release.objdump
163+ for address in $( cat release.out) ; do
164+ grep ${address# 0x} release.objdump
165+ done
147166 edition_check
148167 popd
149168
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ $ qemu-system-arm \
104104{{#include ../ci/logging/app/dev.out}}
105105```
106106
107+ > ** NOTE** : These addresses may not be the ones you get locally because
108+ > addresses of ` static ` variable are not guaranteed to remain the same when the
109+ > toolchain is changed (e.g. optimizations may have improved).
110+
107111Now we have two addresses printed to the console.
108112
109113## Decoding
You can’t perform that action at this time.
0 commit comments