Skip to content

Enable LLDB debug info tests on CI #141539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
10 changes: 10 additions & 0 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
sudo \
gdb \
lldb-19 \
llvm-19-tools \
llvm-19-dev \
libedit-dev \
Expand All @@ -33,6 +34,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*

# The official LLDB symbolic links seems to be broken, this is a workaround to fix them.
RUN ln -sf ../../../liblldb.so.1 /usr/lib/llvm-19/lib/python3.12/site-packages/lldb/_lldb.cpython-312-x86_64-linux-gnu.so && \
ln -sf ../../../../../x86_64-linux-gnu/libLLVM-19.so /usr/lib/llvm-19/lib/python3/dist-packages/lldb/libLLVM-19.*.so.1 && \
ln -sf ../../../../../x86_64-linux-gnu/libLLVM-19.so /usr/lib/llvm-19/lib/python3/dist-packages/lldb/libLLVM-19.so.1

# This provides hint for LLDB to find the debug server binary.
ENV LLDB_DEBUGSERVER_PATH=/usr/bin/lldb-server-19

# Install powershell (universal package) so we can test x.ps1 on Linux
# FIXME: need a "universal" version that supports libicu74, but for now it still works to ignore that dep.
RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \
Expand All @@ -52,6 +61,7 @@ ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--llvm-root=/usr/lib/llvm-19 \
--enable-llvm-link-shared \
--set build.lldb=lldb-19 \
--set rust.randomize-layout=true \
--set rust.thin-lto-import-instr-limit=10

Expand Down
10 changes: 10 additions & 0 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-20/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
sudo \
gdb \
lldb-20 \
llvm-20-tools \
llvm-20-dev \
libedit-dev \
Expand All @@ -33,6 +34,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*

# The official LLDB symbolic links seems to be broken, this is a workaround to fix them.
RUN ln -sf ../../../liblldb.so.1 /usr/lib/llvm-20/lib/python3.13/site-packages/lldb/_lldb.cpython-313-x86_64-linux-gnu.so && \
ln -sf ../../../../../x86_64-linux-gnu/libLLVM-20.so /usr/lib/llvm-20/lib/python3/dist-packages/lldb/libLLVM-20.*.so.1 && \
ln -sf ../../../../../x86_64-linux-gnu/libLLVM-20.so /usr/lib/llvm-20/lib/python3/dist-packages/lldb/libLLVM-20.so.1

# This provides hint for LLDB to find the debug server binary.
ENV LLDB_DEBUGSERVER_PATH=/usr/bin/lldb-server-20

# Install powershell (universal package) so we can test x.ps1 on Linux
# FIXME: need a "universal" version that supports libicu74, but for now it still works to ignore that dep.
RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \
Expand All @@ -52,6 +61,7 @@ ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--llvm-root=/usr/lib/llvm-20 \
--enable-llvm-link-shared \
--set build.lldb=lldb-20 \
--set rust.randomize-layout=true \
--set rust.thin-lto-import-instr-limit=10

Expand Down
10 changes: 5 additions & 5 deletions tests/debuginfo/by-value-non-immediate-argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@
// lldb-command:run

// lldb-command:v s
// lldb-check:[...] Struct { a = 1 b = 2.5 }
// lldb-check:(by_value_non_immediate_argument::Struct) s = { a = 1 b = 2.5 }
// lldb-command:continue

// lldb-command:v x
// lldb-check:[...] Struct { a = 3 b = 4.5 }
// lldb-check:(by_value_non_immediate_argument::Struct) x = { a = 3 b = 4.5 }
// lldb-command:v y
// lldb-check:[...] 5
// lldb-command:v z
// lldb-check:[...] 6.5
// lldb-command:continue

// lldb-command:v a
// lldb-check:[...] (7, 8, 9.5, 10.5)
// lldb-check:[...] { 0 = 7 1 = 8 2 = 9.5 3 = 10.5 }
// lldb-command:continue

// lldb-command:v a
// lldb-check:[...] Newtype(11.5, 12.5, 13, 14)
// lldb-check:(by_value_non_immediate_argument::Newtype) a = { 0 = 11.5 1 = 12.5 2 = 13 3 = 14 }
// lldb-command:continue

// lldb-command:v x
// lldb-check:[...] Case1 { x: 0, y: 8970181431921507452 }
// lldb-check:(by_value_non_immediate_argument::Enum) x = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 }
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
Expand Down
4 changes: 2 additions & 2 deletions tests/debuginfo/function-arg-initialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@

// NON IMMEDIATE ARGS
// lldb-command:v a
// lldb-check:[...] BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
// lldb-check:(function_arg_initialization::BigStruct) a = { a = 3 b = 4 c = 5 d = 6 e = 7 f = 8 g = 9 h = 10 }
// lldb-command:v b
// lldb-check:[...] BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
// lldb-check:(function_arg_initialization::BigStruct) b = { a = 11 b = 12 c = 13 d = 14 e = 15 f = 16 g = 17 h = 18 }
// lldb-command:continue

// BINDING
Expand Down
10 changes: 5 additions & 5 deletions tests/debuginfo/function-prologue-stepping-regular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

// NON IMMEDIATE ARGS
// lldb-command:v a
// lldb-check:[...] { a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10 }
// lldb-check:(function_prologue_stepping_regular::BigStruct) a = { a = 3 b = 4 c = 5 d = 6 e = 7 f = 8 g = 9 h = 10 }
// lldb-command:v b
// lldb-check:[...] { a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18 }
// lldb-check:(function_prologue_stepping_regular::BigStruct) b = { a = 11 b = 12 c = 13 d = 14 e = 15 f = 16 g = 17 h = 18 }
// lldb-command:continue

// BINDING
Expand Down Expand Up @@ -108,11 +108,11 @@

// LOOP EXPR
// lldb-command:v x
// lldb-check:[...] 43
// NOT WORKING: lldb-check:[...] 43
// lldb-command:v y
// lldb-check:[...] 44
// NOT WORKING: lldb-check:[...] 44
// lldb-command:v z
// lldb-check:[...] 45
// NOT WORKING: lldb-check:[...] 45
// lldb-command:continue

#![allow(unused_variables)]
Expand Down
2 changes: 1 addition & 1 deletion tests/debuginfo/macro-stepping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extern crate macro_stepping; // exports new_scope!()
// lldb-check:[...] #inc-loc2 [...]
// lldb-command:next
// lldb-command:frame select
// lldb-check:[...] #inc-loc1 [...]
// NOT WORKING: lldb-check:[...] #inc-loc1 [...]
// lldb-command:next
// lldb-command:frame select
// lldb-check:[...] #inc-loc2 [...]
Expand Down
10 changes: 5 additions & 5 deletions tests/debuginfo/method-on-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

// STACK BY REF
// lldb-command:v *self
// lldb-check:[...] Variant2(117901063)
// lldb-check:(method_on_enum::Enum) *self = { value = { 0 = 117901063 } $discr$ = 1 }
// lldb-command:v arg1
// lldb-check:[...] -1
// lldb-command:v arg2
Expand All @@ -70,7 +70,7 @@

// STACK BY VAL
// lldb-command:v self
// lldb-check:[...] Variant2(117901063)
// lldb-check:(method_on_enum::Enum) self = { value = { 0 = 117901063 } $discr$ = 1 }
// lldb-command:v arg1
// lldb-check:[...] -3
// lldb-command:v arg2
Expand All @@ -79,7 +79,7 @@

// OWNED BY REF
// lldb-command:v *self
// lldb-check:[...] Variant1 { x: 1799, y: 1799 }
// lldb-check:(method_on_enum::Enum) *self = { value = { x = 1799 y = 1799 } $discr$ = 0 }
// lldb-command:v arg1
// lldb-check:[...] -5
// lldb-command:v arg2
Expand All @@ -88,7 +88,7 @@

// OWNED BY VAL
// lldb-command:v self
// lldb-check:[...] Variant1 { x: 1799, y: 1799 }
// lldb-check:(method_on_enum::Enum) self = { value = { x = 1799 y = 1799 } $discr$ = 0 }
// lldb-command:v arg1
// lldb-check:[...] -7
// lldb-command:v arg2
Expand All @@ -97,7 +97,7 @@

// OWNED MOVED
// lldb-command:v *self
// lldb-check:[...] Variant1 { x: 1799, y: 1799 }
// lldb-check:(method_on_enum::Enum) *self = { value = { x = 1799 y = 1799 } $discr$ = 0 }
// lldb-command:v arg1
// lldb-check:[...] -9
// lldb-command:v arg2
Expand Down
20 changes: 10 additions & 10 deletions tests/debuginfo/option-like-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,34 @@
// lldb-command:run

// lldb-command:v some
// lldb-check:[...] Some(&0x[...])
// lldb-check:(core::option::Option<&u32>) some = { value = { 0 = 0x0000555555556014 } }

// lldb-command:v none
// lldb-check:[...] None
// lldb-check:(core::option::Option<&u32>) none = { value = $discr$ = 0 }

// lldb-command:v full
// lldb-check:[...] Full(454545, &0x[...], 9988)
// lldb-check:(option_like_enum::MoreFields) full = { value = { 0 = 454545 1 = 0x0000555555556008 2 = 9988 } $discr$ = 0 }

// lldb-command:v empty
// lldb-check:[...] Empty
// lldb-check:(option_like_enum::MoreFields) empty = { value = $discr$ = 1 }

// lldb-command:v droid
// lldb-check:[...] Droid { id: 675675, range: 10000001, internals: &0x[...] }
// lldb-check:(option_like_enum::NamedFields) droid = { value = { id = 675675 range = 10000001 internals = 0x0000555555556008 } $discr$ = 0 }

// lldb-command:v void_droid
// lldb-check:[...] Void
// lldb-check:(option_like_enum::NamedFields) void_droid = { value = $discr$ = 1 }

// lldb-command:v some_str
// lldb-check:[...] Some("abc")
// lldb-check:(core::option::Option<&str>) some_str = { value = { 0 = "abc" { [0] = 'a' [1] = 'b' [2] = 'c' } } }

// lldb-command:v none_str
// lldb-check:[...] None
// lldb-check:(core::option::Option<&str>) none_str = { value = $discr$ = 0 }

// lldb-command:v nested_non_zero_yep
// lldb-check:[...] Yep(10.5, NestedNonZeroField { a: 10, b: 20, c: &[...] })
// lldb-check:(option_like_enum::NestedNonZero) nested_non_zero_yep = { value = { 0 = 10.5 1 = { a = 10 b = 20 c = 0x0000555555556018 } } }

// lldb-command:v nested_non_zero_nope
// lldb-check:[...] Nope
// lldb-check:nested_non_zero_nope = { value = $discr$ = 0 }


#![feature(omit_gdb_pretty_printer_section)]
Expand Down
4 changes: 2 additions & 2 deletions tests/debuginfo/pretty-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@


// lldb-command:v some
// lldb-check:[...] some = Some(8)
// lldb-check:[...] some = { value = { 0 = 8 } $discr$ = 1 }

// lldb-command:v none
// lldb-check:[...] none = None
// lldb-check:[...] none = { value = $discr$ = 0 }

// lldb-command:v os_string
// lldb-check:[...] os_string = "IAMA OS string 😃" { inner = { inner = size=19 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'O' [6] = 'S' [7] = ' ' [8] = 's' [9] = 't' [10] = 'r' [11] = 'i' [12] = 'n' [13] = 'g' [14] = ' ' [15] = '\xf0' [16] = '\x9f' [17] = '\x98' [18] = '\x83' } } }
Expand Down
6 changes: 3 additions & 3 deletions tests/debuginfo/struct-in-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
// lldb-command:run

// lldb-command:v case1
// lldb-check:[...] Case1(0, Struct { x: 2088533116, y: 2088533116, z: 31868 })
// lldb-check:(struct_in_enum::Regular) case1 = { value = { 0 = 0 1 = { x = 2088533116 y = 2088533116 z = 31868 } } $discr$ = 0 }
// lldb-command:v case2
// lldb-check:[...] Case2(0, 1229782938247303441, 4369)
// lldb-check:(struct_in_enum::Regular) case2 = { value = { 0 = 0 1 = 1229782938247303441 2 = 4369 } $discr$ = 1 }

// lldb-command:v univariant
// lldb-check:[...] TheOnlyCase(Struct { x: 123, y: 456, z: 789 })
// lldb-check:(struct_in_enum::Univariant) univariant = { value = { 0 = { x = 123 y = 456 z = 789 } } }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
Expand Down
Loading