Skip to content
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

Symbol-mangling (v0) should show difference between async / closure / generator #104830

Open
Swatinem opened this issue Nov 24, 2022 · 1 comment
Labels
A-closures Area: Closures (`|…| { … }`) A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Swatinem
Copy link
Contributor

The following code:

pub async fn fn_with_nested_block() -> Backtrace {
    None.unwrap_or_else(|| async { Backtrace::force_capture() })
        .await
}

Generates the following demangled symbol with legacy demangling:

async_codegen::fn_with_nested_block::{{closure}}::{{closure}}::{{closure}}

(v0 mangling is similar, but with {closure#0} instead)

Whereas Windows mangling gives this fn name:

async_codegen::fn_with_nested_block::async_fn$0::closure$0::async_block$0

This makes it clear what is an async fn, closure or async block. v0 symbol mangling should make a similar distinction.

#104333 is a first attempt to thread the necessary information through to the place that does the symbol mangling, but actually extending the v0 symbol mangling format / spec is necessary as well to fully solve this.

@jyn514
Copy link
Member

jyn514 commented Apr 12, 2023

v0 is a public spec that is already been implemented by other tools (e.g. gdb). is this proposed change backwards compatible? If not, is it enough to extend the tools or does there need to be a new v1 format?

@jyn514 jyn514 added A-linkage Area: linking into static, shared libraries and binaries A-closures Area: Closures (`|…| { … }`) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants