Skip to content

Commit 2a190c0

Browse files
committed
Fix regex and add tests for Path
1 parent 05463c9 commit 2a190c0

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/etc/lldb_commands

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)R
1616
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)RefMut<.+>$" --category Rust
1717
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)RefCell<.+>$" --category Rust
1818
type summary add -F lldb_lookup.summary_lookup -e -x -h "^core::num::([a-z_]+::)*NonZero.+$" --category Rust
19-
type summary add -F lldb_lookup.summary_lookup -e -x -h "^&(mut )?std::path::Path$" --category Rust
2019
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
20+
type summary add -F lldb_lookup.summary_lookup -e -x -h "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust
2121
type category enable Rust

src/etc/rust_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class RustType(object):
5353
STD_REF_MUT_REGEX = re.compile(r"^(core::(\w+::)+)RefMut<.+>$")
5454
STD_REF_CELL_REGEX = re.compile(r"^(core::(\w+::)+)RefCell<.+>$")
5555
STD_NONZERO_NUMBER_REGEX = re.compile(r"^core::num::([a-z_]+::)*NonZero.+$")
56-
STD_PATH_REGEX = re.compile(r"^&(mut )?std::path::Path$")
5756
STD_PATHBUF_REGEX = re.compile(r"^(std::([a-z_]+::)+)PathBuf$")
57+
STD_PATH_REGEX = re.compile(r"^&(mut )?(std::([a-z_]+::)+)Path$")
5858

5959
TUPLE_ITEM_REGEX = re.compile(r"__\d+$")
6060

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,8 +1494,8 @@ impl<'test> TestCx<'test> {
14941494
"^(core::([a-z_]+::)+)RefMut<.+>$",
14951495
"^(core::([a-z_]+::)+)RefCell<.+>$",
14961496
"^core::num::([a-z_]+::)*NonZero.+$",
1497-
"^&(mut )?std::path::Path$",
14981497
"^(std::([a-z_]+::)+)PathBuf$",
1498+
"^&(mut )?(std::([a-z_]+::)+)Path$",
14991499
];
15001500

15011501
// In newer versions of lldb, persistent results (the `$N =` part at the start of

tests/debuginfo/path.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66

77
// lldb-command:run
88

9-
// lldb-command:print path
10-
// lldb-check:[...]$0 = strong=11, weak=1 { value = 111 }
119
// lldb-command:print pathbuf
12-
// lldb-check:[...]$1 = strong=21, weak=1 { data = 222 }
10+
// lldb-check:[...]$0 = "/some/path" { inner = "/some/path" { inner = { inner = size=10 { [0] = '/' [1] = 's' [2] = 'o' [3] = 'm' [4] = 'e' [5] = '/' [6] = 'p' [7] = 'a' [8] = 't' [9] = 'h' } } } }
11+
// lldb-command:po pathbuf
12+
// lldb-check:"/some/path"
13+
// lldb-command:print path
14+
// lldb-check:[...]$1 = "/some/path" { data_ptr = [...] length = 10 }
1315

1416
use std::path::Path;
1517

1618
fn main() {
1719
let path = Path::new("/some/path");
18-
let pathbuf = &path.to_path_buf();
20+
let pathbuf = path.to_path_buf();
1921

2022
zzz(); // #break
2123
}

0 commit comments

Comments
 (0)