[Debugger Visualizers] Optimize lookup behavior
Background
Almost all of the commands in lldb_commands used a regex to associate a type with the synthetic_lookup and summary_lookup python functions. When looking up a type, LLDB iterates through the commands in reverse order (so that new commands can overwrite old ones), stopping when it finds a match. These lookups are cached, but it's a shallow cache (e.g. when Vec<T> is matched by lldb, it will always point to synthetic_lookup, NOT the result of synthetic_lookup which would be StdVecSyntheticProvider).
This becomes a problem because within synthetic_lookup and summary_lookup we run classify_rust_type which checks exact same regexes again. This causes 2 issues:
- running the regexes via lldb commands is even more of a waste because the final check is a
.*regex that associates withsynthetic_lookupanyway - Every time lldb wants to display a value, that value must run the entirety of
synthetic_lookupand run its type through 19 regexes + some assorted checks every single time. Those checks take between 1 and 100 microseconds depending on the type.
On a 10,000 element Vec<i32> (which bypasses classify_struct and therefore the 19 regexes), ~30 milliseconds are spent on classify_rust_type. For a 10,000 element Vec<UserDefinedStruct> that jumps up to ~350 milliseconds.
The salt on the wound is that some of those 19 regexes are useless (BTreeMap and BTreeSet which don't even have synthetic/summary providers so it doesn't matter if we know what type it is), and then the results of that lookup function use string-comparisons in a giant if...elif...elif chain.
Solution
To fix all of that, the lldb_commands now point directly to their appropriate synthetic/summary when possible. In cases where there was extra logic, streamlined functions have been added that have much fewer types being passed in, thus only need to do one or two simple checks (e.g. classify_hashmap and classify_hashset).
Some of the lldb_commands regexes were also consolidated to reduce the total number of commands we pass to lldb (e.g. NonZero
An extra upshot is that summary_lookup could be completely removed due to being redundant.
r? @Mark-Simulacrum
rustbot has assigned @Mark-Simulacrum. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
While I'm not comfortable reviewing this myself (and it might be tricky to find someone who is), I do want to at least say thanks for working on it.
If it helps the review any, this is more or less how it should have been written from the start. The type synthetic add -l technically expects a python class (-l is short for --python-class), it's sortof a hack that we exploit LLDB not being able to differentiate between an initializer function and a flat function. It's nice because we can check extra bits of the value without callback-based type matching (which was only introduced in lldb 19.0), but I'm not sure why it was written the way it was in cases like Vec<T> that are unambiguous.
The MSVC providers I added a while ago already point directly to the initializer rather than taking a trip through synthetic_lookup and summary_lookup first. This patch just applies that to all of the commands because it's significantly faster.
There shouldn't be any actual changes for end-users (aside from IndirectionSyntheticProvider fixing a minor bug with pointer types).
r=me if this is still ready to go (not sure if other changes have landed in the last month that make a rebase make sense). I think we can land this and revert/revisit if it runs into issues, the description makes sense to me and the changes seem reasonable.
@bors r=Mark-Simulacrum,jieyouxu rollup
:pushpin: Commit 2e8e6181111dcbfd926886fc9f8e5188aeba3572 has been approved by Mark-Simulacrum,jieyouxu
It is now in the queue for this repository.
Uh actually @Walnut356, this doesn't need a rebase or anything, right? If not, please r= us @bors r- @bors delegate+
:v: @Walnut356, you can now approve this pull request!
If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu
@bors r=@jieyouxu
:pushpin: Commit 2e8e6181111dcbfd926886fc9f8e5188aeba3572 has been approved by jieyouxu
It is now in the queue for this repository.
@bors r=Mark-Simulacrum,jieyouxu
:bulb: This pull request was already approved, no need to approve it again.
:pushpin: Commit 2e8e6181111dcbfd926886fc9f8e5188aeba3572 has been approved by Mark-Simulacrum,jieyouxu
It is now in the queue for this repository.
:hourglass: Testing commit 2e8e6181111dcbfd926886fc9f8e5188aeba3572 with merge 3d0047283f472ed2cf4cf77d818bcde3924b35e8...
The job aarch64-apple failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
---- [debuginfo-lldb] tests/debuginfo/basic-types-globals.rs#no-lto stdout ----
NOTE: compiletest thinks it is using LLDB version 1500
error in revision `no-lto`: check directive(s) from `/Users/runner/work/rust/rust/tests/debuginfo/basic-types-globals.rs` not found in debugger output. errors:
(basic-types-globals.rs:16) ` ::C::[...] = 97`
the following subset of check directive(s) was found successfully:
(basic-types-globals.rs:12) `(bool) basic_types_globals::B::h5660efbf45e78628 = false `
(basic-types-globals.rs:14) `(long) basic_types_globals::I::h3e308daf23711ad4 = -1 `
(basic-types-globals.rs:18) `(char) basic_types_globals::I8::h6c3f5a1b75ee0df9 = 68 `
(basic-types-globals.rs:20) `(short) basic_types_globals::I16::h7382ac16a7f36fc8 = -16 `
(basic-types-globals.rs:22) `(int) basic_types_globals::I32::h361c1cc8eb9a5701 = -32 `
(basic-types-globals.rs:24) `(long) basic_types_globals::I64::h0d89980e26c5280e = -64 `
(basic-types-globals.rs:26) `(unsigned long) basic_types_globals::U::hd9fd53edb64cf482 = 1 `
(basic-types-globals.rs:28) `(unsigned char) basic_types_globals::U8::hb0d2e3133db3e129 = 100 `
(basic-types-globals.rs:30) `(unsigned short) basic_types_globals::U16::h1af09f8a453ebe80 = 16 `
(basic-types-globals.rs:32) `(unsigned int) basic_types_globals::U32::hd82a91576d038be1 = 32 `
(basic-types-globals.rs:34) `(unsigned long) basic_types_globals::U64::h784b114dce24684d = 64 `
(basic-types-globals.rs:36) `(__fp16) basic_types_globals::F16::h9cb8fd691363fc7f = 1.5 `
(basic-types-globals.rs:38) `(float) basic_types_globals::F32::hc2f05b8bc116053c = 2.5 `
(basic-types-globals.rs:40) `(double) basic_types_globals::F64::h98ffa96bf7cc5c76 = 3.5 `
status: exit status: 0
command: LLDB_BATCHMODE_SCRIPT_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.no-lto.lldb/basic-types-globals.debugger.script" LLDB_BATCHMODE_TARGET_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.no-lto.lldb/a" PYTHONPATH="/Users/runner/work/rust/rust/src/etc" PYTHONUNBUFFERED="1" "lldb" "--one-line" "script --language python -- import lldb_batchmode; lldb_batchmode.main()"
--- stdout -------------------------------
(lldb) script --language python -- import lldb_batchmode; lldb_batchmode.main()
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.no-lto.lldb/basic-types-globals.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.no-lto.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.no-lto.lldb/a'
settings set auto-confirm true
settings set target.inherit-tcc true
version
lldb-1500.0.404.7 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
command script import /Users/runner/work/rust/rust/src/etc/lldb_lookup.py
# LLDB iterates through these in reverse order to discover summaries/synthetics that means the top
# of the list can be "overwritten" by items lower on the list. Be careful when reordering items.
# Forces test-compliant formatting to all other types
type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust
# Std String
type synthetic add -l lldb_lookup.StdStringSyntheticProvider -x "^(alloc::([a-z_]+::)+)String$" --category Rust
type summary add -F lldb_lookup.StdStringSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)String$" --category Rust
# Std str
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?str$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -x -h "^&(mut )?str$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStrSyntheticProvider -x "^ref(_mut)?\$<str\$>$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -h -x "^ref(_mut)?\$<str\$>$" --category Rust
# Array/Slice
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?\\[.+\\]$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^&(mut )?\\[.+\\]$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStdSliceSyntheticProvider -x "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
type summary add -F lldb_lookup.StdSliceSummaryProvider -e -x -h "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
# OsString
type summary add -F lldb_lookup.StdOsStringSummaryProvider -e -x -h "^(std::ffi::([a-z_]+::)+)OsString$" --category Rust
# Vec
type synthetic add -l lldb_lookup.StdVecSyntheticProvider -x "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
# VecDeque
type synthetic add -l lldb_lookup.StdVecDequeSyntheticProvider -x "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
# HashMap
type synthetic add -l lldb_lookup.classify_hashmap -x "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
# HashSet
type synthetic add -l lldb_lookup.classify_hashset -x "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
# Rc
type synthetic add -l lldb_lookup.StdRcSyntheticProvider -x "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
# Arc
type synthetic add -l lldb_lookup.arc_synthetic -x "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
# Cell
type synthetic add -l lldb_lookup.StdCellSyntheticProvider -x "^(core::([a-z_]+::)+)Cell<.+>$" --category Rust
# RefCell
type synthetic add -l lldb_lookup.StdRefSyntheticProvider -x "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
type summary add -F lldb_lookup.StdRefSummaryProvider -e -x -h "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
# NonZero
type summary add -F lldb_lookup.StdNonZeroNumberSummaryProvider -e -x -h "^(core::([a-z_]+::)+)NonZero(<.+>|I\d{0,3}|U\d{0,3})$" --category Rust
# PathBuf
type summary add -F lldb_lookup.StdPathBufSummaryProvider -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
# Path
type summary add -F lldb_lookup.StdPathSummaryProvider -e -x -h "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust
# Enum
## MSVC
type synthetic add -l lldb_lookup.MSVCEnumSyntheticProvider -x "^enum2\$<.+>$" --category Rust
type summary add -F lldb_lookup.MSVCEnumSummaryProvider -e -x -h "^enum2\$<.+>$" --category Rust
## MSVC Variants
type synthetic add -l lldb_lookup.synthetic_lookup -x "^enum2\$<.+>::.*$" --category Rust
# Tuple
type synthetic add -l lldb_lookup.TupleSyntheticProvider -x "^\(.*\)$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCTupleSyntheticProvider -x "^tuple\$<.+>$" --category Rust
type summary add -F lldb_lookup.TupleSummaryProvider -e -x -h "^tuple\$<.+>$" --category Rust
type category enable Rust
breakpoint set --file 'basic-types-globals.rs' --line 96
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`basic_types_globals::main::hd39166442c37b8f4 + 196 at basic-types-globals.rs:96:5, address = 0x0000000100003850
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
Process 45825 stopped * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100003850 a`basic_types_globals::main::hd39166442c37b8f4 at basic-types-globals.rs:96:5 93 static mut F64: f64 = 3.5; 94 95 fn main() { -> 96 _zzz(); // #break ^ 97 98 let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) }; 99 // FIXME: Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which Target 0: (a) stopped. Process 45825 launched: '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.no-lto.lldb/a' (arm64)
v B
(bool) basic_types_globals::B::h5660efbf45e78628 = false
v I
(long) basic_types_globals::I::h3e308daf23711ad4 = -1
v --format=d C
(char32_t) basic_types_globals::C::h6af329c09ad4a2f4 = 97 U+0x00000061 U'a'
v --format=d I8
(char) basic_types_globals::I8::h6c3f5a1b75ee0df9 = 68
v I16
(short) basic_types_globals::I16::h7382ac16a7f36fc8 = -16
v I32
(int) basic_types_globals::I32::h361c1cc8eb9a5701 = -32
v I64
(long) basic_types_globals::I64::h0d89980e26c5280e = -64
v U
(unsigned long) basic_types_globals::U::hd9fd53edb64cf482 = 1
v --format=d U8
(unsigned char) basic_types_globals::U8::hb0d2e3133db3e129 = 100
v U16
(unsigned short) basic_types_globals::U16::h1af09f8a453ebe80 = 16
v U32
(unsigned int) basic_types_globals::U32::hd82a91576d038be1 = 32
v U64
(unsigned long) basic_types_globals::U64::h784b114dce24684d = 64
v F16
(__fp16) basic_types_globals::F16::h9cb8fd691363fc7f = 1.5
v F32
(float) basic_types_globals::F32::hc2f05b8bc116053c = 2.5
v F64
(double) basic_types_globals::F64::h98ffa96bf7cc5c76 = 3.5
quit
------------------------------------------
stderr: none
---- [debuginfo-lldb] tests/debuginfo/basic-types-globals.rs#no-lto stdout end ----
---- [debuginfo-lldb] tests/debuginfo/basic-types-globals.rs#lto stdout ----
NOTE: compiletest thinks it is using LLDB version 1500
error in revision `lto`: check directive(s) from `/Users/runner/work/rust/rust/tests/debuginfo/basic-types-globals.rs` not found in debugger output. errors:
(basic-types-globals.rs:16) ` ::C::[...] = 97`
the following subset of check directive(s) was found successfully:
(basic-types-globals.rs:12) `(bool) basic_types_globals::B::h5660efbf45e78628 = false `
(basic-types-globals.rs:14) `(long) basic_types_globals::I::h3e308daf23711ad4 = -1 `
(basic-types-globals.rs:18) `(char) basic_types_globals::I8::h6c3f5a1b75ee0df9 = 68 `
(basic-types-globals.rs:20) `(short) basic_types_globals::I16::h7382ac16a7f36fc8 = -16 `
(basic-types-globals.rs:22) `(int) basic_types_globals::I32::h361c1cc8eb9a5701 = -32 `
(basic-types-globals.rs:24) `(long) basic_types_globals::I64::h0d89980e26c5280e = -64 `
(basic-types-globals.rs:26) `(unsigned long) basic_types_globals::U::hd9fd53edb64cf482 = 1 `
(basic-types-globals.rs:28) `(unsigned char) basic_types_globals::U8::hb0d2e3133db3e129 = 100 `
(basic-types-globals.rs:30) `(unsigned short) basic_types_globals::U16::h1af09f8a453ebe80 = 16 `
(basic-types-globals.rs:32) `(unsigned int) basic_types_globals::U32::hd82a91576d038be1 = 32 `
(basic-types-globals.rs:34) `(unsigned long) basic_types_globals::U64::h784b114dce24684d = 64 `
(basic-types-globals.rs:36) `(__fp16) basic_types_globals::F16::h9cb8fd691363fc7f = 1.5 `
(basic-types-globals.rs:38) `(float) basic_types_globals::F32::hc2f05b8bc116053c = 2.5 `
(basic-types-globals.rs:40) `(double) basic_types_globals::F64::h98ffa96bf7cc5c76 = 3.5 `
status: exit status: 0
command: LLDB_BATCHMODE_SCRIPT_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.lto.lldb/basic-types-globals.debugger.script" LLDB_BATCHMODE_TARGET_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.lto.lldb/a" PYTHONPATH="/Users/runner/work/rust/rust/src/etc" PYTHONUNBUFFERED="1" "lldb" "--one-line" "script --language python -- import lldb_batchmode; lldb_batchmode.main()"
--- stdout -------------------------------
(lldb) script --language python -- import lldb_batchmode; lldb_batchmode.main()
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.lto.lldb/basic-types-globals.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.lto.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.lto.lldb/a'
settings set auto-confirm true
settings set target.inherit-tcc true
version
lldb-1500.0.404.7 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
command script import /Users/runner/work/rust/rust/src/etc/lldb_lookup.py
# LLDB iterates through these in reverse order to discover summaries/synthetics that means the top
# of the list can be "overwritten" by items lower on the list. Be careful when reordering items.
# Forces test-compliant formatting to all other types
type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust
# Std String
type synthetic add -l lldb_lookup.StdStringSyntheticProvider -x "^(alloc::([a-z_]+::)+)String$" --category Rust
type summary add -F lldb_lookup.StdStringSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)String$" --category Rust
# Std str
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?str$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -x -h "^&(mut )?str$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStrSyntheticProvider -x "^ref(_mut)?\$<str\$>$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -h -x "^ref(_mut)?\$<str\$>$" --category Rust
# Array/Slice
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?\\[.+\\]$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^&(mut )?\\[.+\\]$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStdSliceSyntheticProvider -x "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
type summary add -F lldb_lookup.StdSliceSummaryProvider -e -x -h "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
# OsString
type summary add -F lldb_lookup.StdOsStringSummaryProvider -e -x -h "^(std::ffi::([a-z_]+::)+)OsString$" --category Rust
# Vec
type synthetic add -l lldb_lookup.StdVecSyntheticProvider -x "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
# VecDeque
type synthetic add -l lldb_lookup.StdVecDequeSyntheticProvider -x "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
# HashMap
type synthetic add -l lldb_lookup.classify_hashmap -x "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
# HashSet
type synthetic add -l lldb_lookup.classify_hashset -x "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
# Rc
type synthetic add -l lldb_lookup.StdRcSyntheticProvider -x "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
# Arc
type synthetic add -l lldb_lookup.arc_synthetic -x "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
# Cell
type synthetic add -l lldb_lookup.StdCellSyntheticProvider -x "^(core::([a-z_]+::)+)Cell<.+>$" --category Rust
# RefCell
type synthetic add -l lldb_lookup.StdRefSyntheticProvider -x "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
type summary add -F lldb_lookup.StdRefSummaryProvider -e -x -h "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
# NonZero
type summary add -F lldb_lookup.StdNonZeroNumberSummaryProvider -e -x -h "^(core::([a-z_]+::)+)NonZero(<.+>|I\d{0,3}|U\d{0,3})$" --category Rust
# PathBuf
type summary add -F lldb_lookup.StdPathBufSummaryProvider -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
# Path
type summary add -F lldb_lookup.StdPathSummaryProvider -e -x -h "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust
# Enum
## MSVC
type synthetic add -l lldb_lookup.MSVCEnumSyntheticProvider -x "^enum2\$<.+>$" --category Rust
type summary add -F lldb_lookup.MSVCEnumSummaryProvider -e -x -h "^enum2\$<.+>$" --category Rust
## MSVC Variants
type synthetic add -l lldb_lookup.synthetic_lookup -x "^enum2\$<.+>::.*$" --category Rust
# Tuple
type synthetic add -l lldb_lookup.TupleSyntheticProvider -x "^\(.*\)$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCTupleSyntheticProvider -x "^tuple\$<.+>$" --category Rust
type summary add -F lldb_lookup.TupleSummaryProvider -e -x -h "^tuple\$<.+>$" --category Rust
type category enable Rust
breakpoint set --file 'basic-types-globals.rs' --line 96
Breakpoint 1: where = a`basic_types_globals::main::hd39166442c37b8f4 + 196 at basic-types-globals.rs:96:5, address = 0x0000000100001828
DEBUG: breakpoint added, id = 1
run
Process 46010 stopped * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100001828 a`basic_types_globals::main::hd39166442c37b8f4 at basic-types-globals.rs:96:5 93 static mut F64: f64 = 3.5; 94 95 fn main() { -> 96 _zzz(); // #break ^ 97 98 let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) }; 99 // FIXME: Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which Target 0: (a) stopped. Process 46010 launched: '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/basic-types-globals.lto.lldb/a' (arm64)
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
v B
(bool) basic_types_globals::B::h5660efbf45e78628 = false
v I
(long) basic_types_globals::I::h3e308daf23711ad4 = -1
v --format=d C
(char32_t) basic_types_globals::C::h6af329c09ad4a2f4 = 97 U+0x00000061 U'a'
v --format=d I8
(char) basic_types_globals::I8::h6c3f5a1b75ee0df9 = 68
v I16
(short) basic_types_globals::I16::h7382ac16a7f36fc8 = -16
v I32
(int) basic_types_globals::I32::h361c1cc8eb9a5701 = -32
v I64
(long) basic_types_globals::I64::h0d89980e26c5280e = -64
v U
(unsigned long) basic_types_globals::U::hd9fd53edb64cf482 = 1
v --format=d U8
(unsigned char) basic_types_globals::U8::hb0d2e3133db3e129 = 100
v U16
(unsigned short) basic_types_globals::U16::h1af09f8a453ebe80 = 16
v U32
(unsigned int) basic_types_globals::U32::hd82a91576d038be1 = 32
v U64
(unsigned long) basic_types_globals::U64::h784b114dce24684d = 64
v F16
(__fp16) basic_types_globals::F16::h9cb8fd691363fc7f = 1.5
v F32
(float) basic_types_globals::F32::hc2f05b8bc116053c = 2.5
v F64
(double) basic_types_globals::F64::h98ffa96bf7cc5c76 = 3.5
quit
------------------------------------------
stderr: none
---- [debuginfo-lldb] tests/debuginfo/basic-types-globals.rs#lto stdout end ----
---- [debuginfo-lldb] tests/debuginfo/numeric-types.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1500
error: check directive(s) from `/Users/runner/work/rust/rust/tests/debuginfo/numeric-types.rs` not found in debugger output. errors:
(numeric-types.rs:214) `[...] 11 { __0 = { 0 = 11 } }`
(numeric-types.rs:217) `[...] 22 { __0 = { 0 = 22 } }`
(numeric-types.rs:220) `[...] 33 { __0 = { 0 = 33 } }`
(numeric-types.rs:223) `[...] 44 { __0 = { 0 = 44 } }`
(numeric-types.rs:226) `[...] 55 { __0 = { 0 = 55 } }`
(numeric-types.rs:229) `[...] 66 { __0 = { 0 = 66 } }`
(numeric-types.rs:232) `[...] 77 { __0 = { 0 = 77 } }`
(numeric-types.rs:235) `[...] 88 { __0 = { 0 = 88 } }`
(numeric-types.rs:238) `[...] 99 { __0 = { 0 = 99 } }`
(numeric-types.rs:241) `[...] 100 { __0 = { 0 = 100 } }`
(numeric-types.rs:244) `[...] 111 { __0 = { 0 = 111 } }`
(numeric-types.rs:247) `[...] 122 { __0 = { 0 = 122 } }`
status: exit status: 0
command: LLDB_BATCHMODE_SCRIPT_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/numeric-types.lldb/numeric-types.debugger.script" LLDB_BATCHMODE_TARGET_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/numeric-types.lldb/a" PYTHONPATH="/Users/runner/work/rust/rust/src/etc" PYTHONUNBUFFERED="1" "lldb" "--one-line" "script --language python -- import lldb_batchmode; lldb_batchmode.main()"
--- stdout -------------------------------
(lldb) script --language python -- import lldb_batchmode; lldb_batchmode.main()
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/numeric-types.lldb/numeric-types.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/numeric-types.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/numeric-types.lldb/a'
settings set auto-confirm true
settings set target.inherit-tcc true
version
lldb-1500.0.404.7 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
command script import /Users/runner/work/rust/rust/src/etc/lldb_lookup.py
# LLDB iterates through these in reverse order to discover summaries/synthetics that means the top
# of the list can be "overwritten" by items lower on the list. Be careful when reordering items.
# Forces test-compliant formatting to all other types
type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust
# Std String
type synthetic add -l lldb_lookup.StdStringSyntheticProvider -x "^(alloc::([a-z_]+::)+)String$" --category Rust
type summary add -F lldb_lookup.StdStringSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)String$" --category Rust
# Std str
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?str$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -x -h "^&(mut )?str$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStrSyntheticProvider -x "^ref(_mut)?\$<str\$>$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -h -x "^ref(_mut)?\$<str\$>$" --category Rust
# Array/Slice
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?\\[.+\\]$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^&(mut )?\\[.+\\]$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStdSliceSyntheticProvider -x "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
type summary add -F lldb_lookup.StdSliceSummaryProvider -e -x -h "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
# OsString
type summary add -F lldb_lookup.StdOsStringSummaryProvider -e -x -h "^(std::ffi::([a-z_]+::)+)OsString$" --category Rust
# Vec
type synthetic add -l lldb_lookup.StdVecSyntheticProvider -x "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
# VecDeque
type synthetic add -l lldb_lookup.StdVecDequeSyntheticProvider -x "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
# HashMap
type synthetic add -l lldb_lookup.classify_hashmap -x "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
# HashSet
type synthetic add -l lldb_lookup.classify_hashset -x "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
# Rc
type synthetic add -l lldb_lookup.StdRcSyntheticProvider -x "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
# Arc
type synthetic add -l lldb_lookup.arc_synthetic -x "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
# Cell
type synthetic add -l lldb_lookup.StdCellSyntheticProvider -x "^(core::([a-z_]+::)+)Cell<.+>$" --category Rust
# RefCell
type synthetic add -l lldb_lookup.StdRefSyntheticProvider -x "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
type summary add -F lldb_lookup.StdRefSummaryProvider -e -x -h "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
# NonZero
type summary add -F lldb_lookup.StdNonZeroNumberSummaryProvider -e -x -h "^(core::([a-z_]+::)+)NonZero(<.+>|I\d{0,3}|U\d{0,3})$" --category Rust
# PathBuf
type summary add -F lldb_lookup.StdPathBufSummaryProvider -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
# Path
type summary add -F lldb_lookup.StdPathSummaryProvider -e -x -h "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust
# Enum
## MSVC
type synthetic add -l lldb_lookup.MSVCEnumSyntheticProvider -x "^enum2\$<.+>$" --category Rust
type summary add -F lldb_lookup.MSVCEnumSummaryProvider -e -x -h "^enum2\$<.+>$" --category Rust
## MSVC Variants
type synthetic add -l lldb_lookup.synthetic_lookup -x "^enum2\$<.+>::.*$" --category Rust
# Tuple
type synthetic add -l lldb_lookup.TupleSyntheticProvider -x "^\(.*\)$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCTupleSyntheticProvider -x "^tuple\$<.+>$" --category Rust
type summary add -F lldb_lookup.TupleSummaryProvider -e -x -h "^tuple\$<.+>$" --category Rust
type category enable Rust
breakpoint set --file 'numeric-types.rs' --line 296
DEBUG: breakpoint added, id = 1
Breakpoint 1: where = a`numeric_types::main::hac5c479005112d65 + 1320 at numeric-types.rs:296:5, address = 0x00000001000035e8
DEBUG: registering breakpoint callback, id = 1
Error while trying to register breakpoint callback, id = 1, message = error: could not get num args: can't find callable: breakpoint_callback
run
Process 49046 stopped * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x00000001000035e8 a`numeric_types::main::hac5c479005112d65 at numeric-types.rs:296:5 293 let a_u64 = AtomicU64::new(512); 294 let a_usize = AtomicUsize::new(1024); 295 -> 296 zzz(); // #break ^ 297 } 298 299 fn zzz() { } Target 0: (a) stopped. Process 49046 launched: '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/numeric-types.lldb/a' (arm64)
v/d nz_i8
(core::num::nonzero::NonZero<char>) nz_i8 = 11 { 0 = { 0 = 11 } }
v nz_i16
(core::num::nonzero::NonZero<short>) nz_i16 = 22 { 0 = { 0 = 22 } }
v nz_i32
(core::num::nonzero::NonZero<int>) nz_i32 = 33 { 0 = { 0 = 33 } }
v nz_i64
(core::num::nonzero::NonZero<long>) nz_i64 = 44 { 0 = { 0 = 44 } }
v nz_i128
(core::num::nonzero::NonZero<__int128>) nz_i128 = 55 { 0 = { 0 = 55 } }
v nz_isize
(core::num::nonzero::NonZero<long>) nz_isize = 66 { 0 = { 0 = 66 } }
v/d nz_u8
(core::num::nonzero::NonZero<unsigned char>) nz_u8 = 77 { 0 = { 0 = 77 } }
v nz_u16
(core::num::nonzero::NonZero<unsigned short>) nz_u16 = 88 { 0 = { 0 = 88 } }
v nz_u32
(core::num::nonzero::NonZero<unsigned int>) nz_u32 = 99 { 0 = { 0 = 99 } }
v nz_u64
(core::num::nonzero::NonZero<unsigned long>) nz_u64 = 100 { 0 = { 0 = 100 } }
v nz_u128
(core::num::nonzero::NonZero<unsigned __int128>) nz_u128 = 111 { 0 = { 0 = 111 } }
v nz_usize
(core::num::nonzero::NonZero<unsigned long>) nz_usize = 122 { 0 = { 0 = 122 } }
quit
------------------------------------------
stderr: none
---- [debuginfo-lldb] tests/debuginfo/numeric-types.rs stdout end ----
---- [debuginfo-lldb] tests/debuginfo/union-smoke.rs stdout ----
NOTE: compiletest thinks it is using LLDB version 1500
error: check directive(s) from `/Users/runner/work/rust/rust/tests/debuginfo/union-smoke.rs` not found in debugger output. errors:
(union-smoke.rs:20) `[...] { a = { 0 = '\x01' 1 = '\x01' } b = 257 }`
the following subset of check directive(s) was found successfully:
(union-smoke.rs:17) `(union_smoke::U) u = { a = { 0 = '\x02' 1 = '\x02' } b = 514 } `
status: exit status: 0
command: LLDB_BATCHMODE_SCRIPT_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/union-smoke.lldb/union-smoke.debugger.script" LLDB_BATCHMODE_TARGET_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/union-smoke.lldb/a" PYTHONPATH="/Users/runner/work/rust/rust/src/etc" PYTHONUNBUFFERED="1" "lldb" "--one-line" "script --language python -- import lldb_batchmode; lldb_batchmode.main()"
--- stdout -------------------------------
(lldb) script --language python -- import lldb_batchmode; lldb_batchmode.main()
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/union-smoke.lldb/union-smoke.debugger.script'.
Target executable is '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/union-smoke.lldb/a'.
Current working directory is '/Users/runner/work/rust/rust'
Creating a target for '/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/debuginfo/union-smoke.lldb/a'
settings set auto-confirm true
settings set target.inherit-tcc true
version
lldb-1500.0.404.7 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
command script import /Users/runner/work/rust/rust/src/etc/lldb_lookup.py
# LLDB iterates through these in reverse order to discover summaries/synthetics that means the top
# of the list can be "overwritten" by items lower on the list. Be careful when reordering items.
# Forces test-compliant formatting to all other types
type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust
# Std String
type synthetic add -l lldb_lookup.StdStringSyntheticProvider -x "^(alloc::([a-z_]+::)+)String$" --category Rust
type summary add -F lldb_lookup.StdStringSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)String$" --category Rust
# Std str
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?str$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -x -h "^&(mut )?str$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStrSyntheticProvider -x "^ref(_mut)?\$<str\$>$" --category Rust
type summary add -F lldb_lookup.StdStrSummaryProvider -e -h -x "^ref(_mut)?\$<str\$>$" --category Rust
# Array/Slice
type synthetic add -l lldb_lookup.StdSliceSyntheticProvider -x "^&(mut )?\\[.+\\]$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^&(mut )?\\[.+\\]$" --category Rust
## MSVC
type synthetic add -l lldb_lookup.MSVCStdSliceSyntheticProvider -x "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
type summary add -F lldb_lookup.StdSliceSummaryProvider -e -x -h "^ref(_mut)?\$<slice2\$<.+> >" --category Rust
# OsString
type summary add -F lldb_lookup.StdOsStringSummaryProvider -e -x -h "^(std::ffi::([a-z_]+::)+)OsString$" --category Rust
# Vec
type synthetic add -l lldb_lookup.StdVecSyntheticProvider -x "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
# VecDeque
type synthetic add -l lldb_lookup.StdVecDequeSyntheticProvider -x "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
# HashMap
type synthetic add -l lldb_lookup.classify_hashmap -x "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
# HashSet
type synthetic add -l lldb_lookup.classify_hashset -x "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
type summary add -F lldb_lookup.SizeSummaryProvider -e -x -h "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
# Rc
type synthetic add -l lldb_lookup.StdRcSyntheticProvider -x "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
# Arc
type synthetic add -l lldb_lookup.arc_synthetic -x "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
type summary add -F lldb_lookup.StdRcSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
# Cell
type synthetic add -l lldb_lookup.StdCellSyntheticProvider -x "^(core::([a-z_]+::)+)Cell<.+>$" --category Rust
# RefCell
type synthetic add -l lldb_lookup.StdRefSyntheticProvider -x "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
type summary add -F lldb_lookup.StdRefSummaryProvider -e -x -h "^(core::([a-z_]+::)+)Ref(Cell|Mut)?<.+>$" --category Rust
# NonZero
type summary add -F lldb_lookup.StdNonZeroNumberSummaryProvider -e -x -h "^(core::([a-z_]+::)+)NonZero(<.+>|I\d{0,3}|U\d{0,3})$" --category Rust
# PathBuf
type summary add -F lldb_lookup.StdPathBufSummaryProvider -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
# Path
type summary add -F lldb_lookup.StdPathSummaryProvider -e -x -h "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust
# Enum
## MSVC
type synthetic add -l lldb_lookup.MSVCEnumSyntheticProvider -x "^enum2\$<.+>$" --category Rust
type summary add -F lldb_lookup.MSVCEnumSummaryProvider -e -x -h "^enum2\$<.+>$" --category Rust
## MSVC Variants
type synthetic add -l lldb_lookup.synthetic_lookup -x "^enum2\$<.+>::.*$" --category Rust
:broken_heart: Test failed - checks-actions
That is_msvc check needed to be changed anyway because SBProcess.GetTriple doesn't work quite how we need it to, but it's pretty crazy that it can return None lol
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.
Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.
@bors try jobs=aarch64-apple
:hourglass: Trying commit 0e5475ab1d5e7dafbfd53ad6ec6035469f0c2a0c with merge c4dc4926c5197ff47b02db345958f28abcc6afe6…
To cancel the try build, run the command @bors try cancel.
Workflow: https://github.com/rust-lang/rust/actions/runs/19388630818
:sunny: Try build successful (CI)
Build commit: c4dc4926c5197ff47b02db345958f28abcc6afe6 (c4dc4926c5197ff47b02db345958f28abcc6afe6, parent: 733108b6d4acaa93fe26ae281ea305aacd6aac4e)
:umbrella: The latest upstream changes (presumably #89917) made this pull request unmergeable. Please resolve the merge conflicts.
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.
Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.
@rustbot review