Skip to content

Commit 01a5ed0

Browse files
committed
[temp] probe: the slot the call goes through, and who defines a C library name
1 parent 23e9718 commit 01a5ed0

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎.github/workflows/probe-win-unit-av.yml‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
PY
6363
cat run.txt
6464
cat > cdb.txt <<'CDB'
65-
sxe -c ".echo ==AV==; r; .echo ==STACK==; kn 40; .echo ==CALLER==; ub poi(@rsp) L12; .echo ==AFTER==; u poi(@rsp) L3; .echo ==MODULES==; lm; q" av
65+
sxe -c ".echo ==AV==; r; .echo ==STACK==; kn 12; .echo ==SLOT==; dps unit+0x10eada8-0x60 L28; .echo ==ARG==; da poi(@rdx+8); .echo ==END==; q" av
6666
g
6767
q
6868
CDB
@@ -111,10 +111,14 @@ jobs:
111111
llvm="$USERPROFILE/.mcpp/registry/data/xpkgs/xim-x-llvm/23.1.3/bin"
112112
exe=$(find target -name unit.exe | head -1)
113113
"$llvm/llvm-readobj.exe" --file-headers "$exe" | grep -i -E 'ImageBase|AddressOfEntryPoint|Characteristics' | head
114-
# Symbols the xz objects reference and no object of the build defines.
115-
find target -name '*.o' -o -name '*.obj' | grep -i -E 'xz|lzma' | head -3
116-
xz=$(find target "$USERPROFILE/.mcpp" -type f \( -name '*.o' -o -name '*.obj' -o -name '*.a' -o -name '*.lib' \) 2>/dev/null | grep -i -E 'compat.xz|compat_xz|liblzma' | head -200)
117-
echo "$xz" | head -5; echo "$xz" | wc -l
118-
[ -z "$xz" ] || "$llvm/llvm-nm.exe" --undefined-only $xz 2>/dev/null | awk '{print $NF}' | sort -u > undef.txt
119-
[ -z "$xz" ] || "$llvm/llvm-nm.exe" --defined-only $xz 2>/dev/null | awk '{print $NF}' | sort -u > def.txt
120-
comm -23 undef.txt def.txt | head -80
114+
"$llvm/llvm-readobj.exe" --sections "$exe" | grep -E 'Name:|VirtualAddress|VirtualSize' | paste - - - | head -20
115+
"$llvm/llvm-readobj.exe" --file-headers "$exe" | grep -A1 -E 'ImportTableRVA|ImportAddressTableRVA|DelayImport' | head -12
116+
"$llvm/llvm-readobj.exe" --coff-imports "$exe" > imports.txt 2>&1
117+
grep -c Symbol imports.txt; grep -n -E 'Name:|ImportAddressTableRVA' imports.txt | head -60
118+
grep -n -i -E 'Symbol: (strlen|wcslen|memchr|memcmp|strchr|strcmp)' imports.txt | head
119+
# Who defines a C library name among the objects of the build.
120+
objs=$(find target -type f \( -name '*.o' -o -name '*.obj' \) | head -4000)
121+
echo "$objs" | wc -l
122+
"$llvm/llvm-nm.exe" -A $objs 2>/dev/null | grep -E ' [TtWwVvAaCcDdBbRr] (strlen|wcslen|memcpy|memset|memmove|memcmp|memchr|strcmp|strchr|__imp_strlen)$' | head -40
123+
echo "--- weak or undefined-weak references to strlen"
124+
"$llvm/llvm-nm.exe" -A $objs 2>/dev/null | grep -E ' [wWvV] ' | grep -E 'strlen|__imp_' | head -20

0 commit comments

Comments
 (0)