Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion debugging-sos-lldb-via-core/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ cat lldb.out
grep 'MethodTable: ' lldb.out
grep 'Name: ' lldb.out
string_module=$(grep 'Module: ' lldb.out | head -1 | awk '{print $2}')
string_method_table=$(grep 'MethodTable:' lldb.out | awk '{print $2}')
string_method_table=$(grep 'MethodTable:' lldb.out | head -1 | awk '{print $2}')
lldb-core "dumpmt ${string_method_table}" > lldb.out
cat lldb.out
# On .NET 8, dumpclass needs the EEClass address (from dumpmt output).
# On .NET 9+, EEClass is gone and dumpclass accepts the MethodTable directly.
dumpclass_arg=$(grep 'EEClass:' lldb.out | head -1 | awk '{print $2}' || true)
dumpclass_arg=${dumpclass_arg:-${string_method_table}}

lldb-core 'name2ee *!System.String.ToString' > lldb.out
cat lldb.out
Expand All @@ -213,6 +219,11 @@ to_string_method_descriptor=$(grep 'MethodDesc:' lldb.out | head -1 | awk '{prin
# grep 'Name: System.String' lldb.out
# grep -F "File: ${framework_dir}" lldb.out

echo "[dumpclass]"
lldb-core "dumpclass ${dumpclass_arg}" > lldb.out
cat lldb.out
grep 'Class Name: System.String' lldb.out

echo "[dumpmd]"
lldb-core "dumpmd ${to_string_method_descriptor}" > lldb.out
cat lldb.out
Expand Down
17 changes: 9 additions & 8 deletions debugging-via-dotnet-dump/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,14 @@ fi
heading "dumpclass"
dump-analyze 'name2ee *!System.String' > dump.out
cat dump.out
grep 'EEClass: ' dump.out
string_eeclass=$(grep 'EEClass:' dump.out | { head -1; cat > /dev/null; } | awk '{print $2}')
dump-analyze "dumpclass ${string_eeclass}" > dump.out
string_method_table=$(grep 'MethodTable:' dump.out | { head -1; cat > /dev/null; } | awk '{print $2}')
dump-analyze "dumpmt ${string_method_table}" > dump.out
cat dump.out
# On .NET 8, dumpclass needs the EEClass address (from dumpmt output).
# On .NET 9+, EEClass is gone and dumpclass accepts the MethodTable directly.
dumpclass_arg=$(grep 'EEClass:' dump.out | awk '{print $2}' || true)
dumpclass_arg=${dumpclass_arg:-${string_method_table}}
dump-analyze "dumpclass ${dumpclass_arg}" > dump.out
cat dump.out
grep 'Class Name: System.String' dump.out

Expand Down Expand Up @@ -297,9 +302,6 @@ if grep 'Unmanaged code' dump.out; then
fi
dump-analyze 'name2ee *!System.String.ToString' > dump.out
cat dump.out
grep 'TestDir.dll' dump.out
grep 'System.Runtime.dll' dump.out
grep 'Microsoft.AspNetCore.dll' dump.out
to_string_method_descriptor=$(grep 'MethodDesc:' dump.out | { head -1; cat > /dev/null; } | awk '{print $2}')
dump-analyze "dumpmd ${to_string_method_descriptor}" > dump.out
cat dump.out
Expand All @@ -323,7 +325,7 @@ heading "dumpmt"
dump-analyze 'name2ee *!System.String' > dump.out
cat dump.out
grep 'MethodTable:' dump.out | awk '{print $2}'
string_method_table=$(grep 'MethodTable:' dump.out | awk '{print $2}')
string_method_table=$(grep 'MethodTable:' dump.out | { head -1; cat > /dev/null; } | awk '{print $2}')
dump-analyze "dumpmt ${string_method_table}" > dump.out
cat dump.out
grep -E '^Name:[ \n\t]+System.String' dump.out
Expand Down Expand Up @@ -550,7 +552,6 @@ heading "name2ee"
dump-analyze 'name2ee *!System.String' > dump.out
cat dump.out
grep 'MethodTable: ' dump.out
grep 'EEClass: ' dump.out
grep 'Name: ' dump.out
dump-analyze 'name2ee *!System.String.ToString' > dump.out

Expand Down
Loading