Skip to content

Commit 950eee8

Browse files
committed
Add rudy-lldb as a test artifact
1 parent c74ab9a commit 950eee8

File tree

64 files changed

+14740
-3731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+14740
-3731
lines changed

crates/rudy-dwarf/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ pub trait DwarfDb: salsa::Database {
3838
fn remap_path(&self, path: &Path) -> PathBuf {
3939
let mut path = path.to_path_buf();
4040
for (source, target) in self.get_source_map() {
41+
if source == target {
42+
continue; // No remapping needed
43+
}
4144
if let Ok(stripped) = path.strip_prefix(source) {
4245
tracing::debug!(
4346
"Remapping {} from {} to {}",

crates/rudy-dwarf/src/modules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ mod tests {
269269
let _guard = test_utils::init_tracing_and_insta();
270270

271271
let platform = "aarch64-unknown-linux-gnu";
272-
let example_name = "enums";
272+
let example_name = "examples/enums";
273273

274274
let artifacts = test_utils::artifacts_dir(Some(platform));
275275
let db = test_utils::test_db(Some(platform));

crates/rudy-dwarf/src/snapshots/module_index.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source: crates/rudy-dwarf/src/modules.rs
33
expression: output
44
snapshot_kind: text
55
---
6-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-unknown-linux-gnu/enums ===
6+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-unknown-linux-gnu/examples/enums ===
77
===== By Offset =====
88

99
0x0000000b - 0x0000002a:

crates/rudy-dwarf/src/symbols/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ mod test {
289289
// Initialize the debug database and load a binary with debug info
290290
// test on macos file because it has the external symbol files
291291
let artifact_dir = crate::test_utils::artifacts_dir(Some("aarch64-apple-darwin"));
292-
let exe_path = artifact_dir.join("small");
292+
let exe_path = artifact_dir.join("examples/small");
293293

294294
let db = crate::test_utils::test_db(Some("aarch64-apple-darwin"));
295295
let db = &db;

crates/rudy-dwarf/src/types/resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ mod test {
591591
let artifacts = test_utils::artifacts_dir(Some("aarch64-apple-darwin"));
592592
let db = test_utils::test_db(Some("aarch64-apple-darwin"));
593593
let db = &db;
594-
let binary = test_utils::load_binary(db, artifacts.join("std_types"));
594+
let binary = test_utils::load_binary(db, artifacts.join("examples/std_types"));
595595

596596
let (_, symbol_index) = crate::symbols::index_symbol_map(db, binary).unwrap();
597597

crates/rudy-dwarf/src/visitor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ mod test {
476476

477477
let small_file = crate::test_utils::root_artifacts_dir()
478478
.join("x86_64-unknown-linux-gnu")
479+
.join("examples")
479480
.join("small");
480481
let db = crate::test_utils::test_db(None);
481482
let db = &db;
@@ -549,6 +550,7 @@ mod test {
549550

550551
let small_file = crate::test_utils::root_artifacts_dir()
551552
.join("x86_64-unknown-linux-gnu")
553+
.join("examples")
552554
.join("small");
553555

554556
// Create a test database

crates/rudy-dwarf/tests/example_visitor.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,21 @@ fn dwarf_outline_examples(#[case] target: &'static str) {
211211
let db = test_db(Some(target));
212212
let db = &db;
213213

214-
for name in ["method_discovery", "simple_test", "lldb_demo"] {
215-
let path = artifact_dir.join(name);
214+
for (folder, bin) in [
215+
("examples", "method_discovery"),
216+
("examples", "simple_test"),
217+
("examples", "lldb_demo"),
218+
("rudy-lldb", "rudy-lldb-server"),
219+
] {
220+
let path = artifact_dir.join(folder).join(bin);
216221
if !path.exists() {
217222
panic!(
218223
"Example binary not found at: {}. Please run `cargo xtask build-examples` first.",
219224
path.display()
220225
);
221226
}
222227

223-
tracing::debug!("Examining DWARF structure for: {name}");
228+
tracing::debug!("Examining DWARF structure for: {bin}");
224229

225230
let binary = load_binary(db, &path);
226231
let (debug_files, _) =
@@ -235,7 +240,7 @@ fn dwarf_outline_examples(#[case] target: &'static str) {
235240
// Only examine files that likely contain our method_discovery code
236241
tracing::debug!("Examining DWARF structure for: {file_name}",);
237242

238-
let mut visitor = TestVisitor::new_for_module(name);
243+
let mut visitor = TestVisitor::new_for_module(&bin.replace('-', "_"));
239244
walk_file(db, *debug_file, &mut visitor).unwrap();
240245

241246
let structure = visitor.format_structure();

crates/rudy-dwarf/tests/snapshots/[email protected]

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source: crates/rudy-dwarf/tests/example_visitor.rs
33
expression: all_structure
44
snapshot_kind: text
55
---
6-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/lldb_demo-4fb46d66525a9738.01uii0t86evghvf301f7rulbz.0tnqea9.rcgu.o ===
6+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/examples/lldb_demo-4fb46d66525a9738.01uii0t86evghvf301f7rulbz.1q0t443.rcgu.o ===
77
0x0000063a: namespace 'lldb_demo'
88
0x0000063f: structure_type 'User'
99
0x00000677: subprogram 'new'
@@ -30,20 +30,20 @@ snapshot_kind: text
3030
0x0000082c: formal_parameter 'self'
3131
0x0000083a: formal_parameter 'f'
3232

33-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/lldb_demo-4fb46d66525a9738.20r8zifbyvfytodsihxql4hg9.0tnqea9.rcgu.o ===
33+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/examples/lldb_demo-4fb46d66525a9738.20r8zifbyvfytodsihxql4hg9.1q0t443.rcgu.o ===
3434
0x00000768: namespace 'lldb_demo'
3535
0x0000076d: structure_type 'User'
3636

37-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/lldb_demo-4fb46d66525a9738.57j50cccl61bps5o28s4qlnsi.0tnqea9.rcgu.o ===
37+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/examples/lldb_demo-4fb46d66525a9738.57j50cccl61bps5o28s4qlnsi.1q0t443.rcgu.o ===
3838
0x00000d9d: namespace 'lldb_demo'
3939
0x00000da2: structure_type 'User'
4040

41-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/lldb_demo-4fb46d66525a9738.c7k85xtb883ariwxp3n146inh.0tnqea9.rcgu.o ===
41+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/examples/lldb_demo-4fb46d66525a9738.c7k85xtb883ariwxp3n146inh.1q0t443.rcgu.o ===
4242
0x00000ce8: namespace 'lldb_demo'
4343
0x00000ced: structure_type 'User'
4444
0x00000d26: structure_type 'Session'
4545

46-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/lldb_demo-4fb46d66525a9738.drq4p2mtcsfl4l46k3nunx3x1.0tnqea9.rcgu.o ===
46+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-apple-darwin/examples/lldb_demo-4fb46d66525a9738.drq4p2mtcsfl4l46k3nunx3x1.1q0t443.rcgu.o ===
4747
0x000003fc: namespace 'lldb_demo'
4848
0x00000401: structure_type 'Session'
4949
0x0000042e: structure_type 'User'

crates/rudy-dwarf/tests/snapshots/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source: crates/rudy-dwarf/tests/example_visitor.rs
33
expression: all_structure
44
snapshot_kind: text
55
---
6-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-unknown-linux-gnu/lldb_demo ===
6+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/aarch64-unknown-linux-gnu/examples/lldb_demo ===
77
0x00001234: namespace 'lldb_demo'
88
0x00001239: structure_type 'User'
99
0x000028d2: namespace 'lldb_demo'

crates/rudy-dwarf/tests/snapshots/lldb_demo@x86_64-apple-darwin.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ source: crates/rudy-dwarf/tests/example_visitor.rs
33
expression: all_structure
44
snapshot_kind: text
55
---
6-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/lldb_demo-90fe5ea3040c00ba.250r9cg3u20xg4v1xfhbynaxh.1bsllys.rcgu.o ===
6+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/examples/lldb_demo-90fe5ea3040c00ba.250r9cg3u20xg4v1xfhbynaxh.1rf44xu.rcgu.o ===
77
0x00000ce8: namespace 'lldb_demo'
88
0x00000ced: structure_type 'User'
99
0x00000d26: structure_type 'Session'
1010

11-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/lldb_demo-90fe5ea3040c00ba.50yruz5xmea4zh9wkm678i1gm.1bsllys.rcgu.o ===
11+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/examples/lldb_demo-90fe5ea3040c00ba.50yruz5xmea4zh9wkm678i1gm.1rf44xu.rcgu.o ===
1212
0x00000da2: namespace 'lldb_demo'
1313
0x00000da7: structure_type 'User'
1414

15-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/lldb_demo-90fe5ea3040c00ba.7fl81bntag6qjwalz2tcq5a9r.1bsllys.rcgu.o ===
15+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/examples/lldb_demo-90fe5ea3040c00ba.7fl81bntag6qjwalz2tcq5a9r.1rf44xu.rcgu.o ===
1616
0x0000063a: namespace 'lldb_demo'
1717
0x0000063f: structure_type 'User'
1818
0x00000677: subprogram 'new'
@@ -39,11 +39,11 @@ snapshot_kind: text
3939
0x0000082c: formal_parameter 'self'
4040
0x0000083a: formal_parameter 'f'
4141

42-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/lldb_demo-90fe5ea3040c00ba.dzf5mz8vp6030z6z199cw39a6.1bsllys.rcgu.o ===
42+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/examples/lldb_demo-90fe5ea3040c00ba.dzf5mz8vp6030z6z199cw39a6.1rf44xu.rcgu.o ===
4343
0x000003fc: namespace 'lldb_demo'
4444
0x00000401: structure_type 'Session'
4545
0x0000042e: structure_type 'User'
4646

47-
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/lldb_demo-90fe5ea3040c00ba.f03iuj98mgwh4a2yt3jmjq3xm.1bsllys.rcgu.o ===
47+
=== [CARGO_WORKSPACE_DIR]/test-artifacts/x86_64-apple-darwin/examples/lldb_demo-90fe5ea3040c00ba.f03iuj98mgwh4a2yt3jmjq3xm.1rf44xu.rcgu.o ===
4848
0x00000768: namespace 'lldb_demo'
4949
0x0000076d: structure_type 'User'

0 commit comments

Comments
 (0)