Lines Matching +full:a +full:- +full:za +full:- +full:z0 +full:- +full:9 +full:-
1 // SPDX-License-Identifier: GPL-2.0
5 #include "demangle-rust.h"
16 * The last component of the path is a 64-bit hash in lowercase hex, prefixed
17 * with "h". Rust does not have a global namespace between crates, an illusion
21 * Any path component not starting with a XID_Start character is prefixed with
40 * A double ".." means "::" and a single "." means "-".
42 * The only characters allowed in the mangled symbol are a-zA-Z0-9 and _.:$
55 * sym: symbol that has been through BFD-demangling
61 * 2. As a sanity check, the hash must use between 5 and 15 of the 16 possible
63 * may see a false negative. The point is to notice path components that
65 * this case a false positive (non-Rust symbol has an important path
66 * component removed because it looks like a Rust hash) is worse than a
70 * 3. There must be no characters other than a-zA-Z0-9 and _.:$
72 * 4. There must be no unrecognized $-sign sequences.
74 * 5. There must be no sequence of three or more dots in a row ("...").
89 len_without_hash = len - (hash_prefix_len + hash_len); in rust_is_mangled()
97 * A hash is the prefix "::h" followed by 16 lowercase hex digits. The hex
113 if (*str >= '0' && *str <= '9') in is_prefixed_hash()
114 seen[*str - '0'] = true; in is_prefixed_hash()
115 else if (*str >= 'a' && *str <= 'f') in is_prefixed_hash()
116 seen[*str - 'a' + 10] = true; in is_prefixed_hash()
160 case 'a' ... 'z': in looks_like_rust()
161 case 'A' ... 'Z': in looks_like_rust()
162 case '0' ... '9': in looks_like_rust()
178 * The input is demangled in-place because the mangled name is always longer
193 end = sym + strlen(sym) - (hash_prefix_len + hash_len); in rust_demangle_sym()
211 pr_err("demangle-rust: unexpected escape sequence"); in rust_demangle_sym()
217 * If this is the start of a path component and the next in rust_demangle_sym()
220 * sure the path component begins with a XID_Start in rust_demangle_sym()
223 if ((in == sym || in[-1] == ':') && in[1] == '$') in rust_demangle_sym()
235 /* "." becomes "-" */ in rust_demangle_sym()
236 *out++ = '-'; in rust_demangle_sym()
240 case 'a' ... 'z': in rust_demangle_sym()
241 case 'A' ... 'Z': in rust_demangle_sym()
242 case '0' ... '9': in rust_demangle_sym()
247 pr_err("demangle-rust: unexpected character '%c' in symbol\n", in rust_demangle_sym()