// Copyright 2024 The Abseil Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "absl/debugging/internal/demangle_rust.h" #include <cstddef> #include <cstdint> #include <cstring> #include <limits> #include "absl/base/attributes.h" #include "absl/base/config.h" #include "absl/debugging/internal/decode_rust_punycode.h" namespace absl { ABSL_NAMESPACE_BEGIN namespace debugging_internal { namespace { // Same step limit as the C++ demangler in demangle.cc uses. constexpr int kMaxReturns = …; bool IsDigit(char c) { … } bool IsLower(char c) { … } bool IsUpper(char c) { … } bool IsAlpha(char c) { … } bool IsIdentifierChar(char c) { … } bool IsLowerHexDigit(char c) { … } const char* BasicTypeName(char c) { … } // Parser for Rust symbol mangling v0, whose grammar is defined here: // // https://doc.rust-lang.org/rustc/symbol-mangling/v0.html#symbol-grammar-summary class RustSymbolParser { … }; } // namespace bool DemangleRustSymbolEncoding(const char* mangled, char* out, size_t out_size) { … } } // namespace debugging_internal ABSL_NAMESPACE_END } // namespace absl