<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/test/debuginfo/generator-objects.rs, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-01-11T09:32:08+00:00</updated>
<entry>
<title>Move /src/test to /tests</title>
<updated>2023-01-11T09:32:08+00:00</updated>
<author>
<name>Albert Larsan</name>
<email>74931857+albertlarsan68@users.noreply.github.com</email>
</author>
<published>2023-01-05T08:13:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cf2dff2b1e3fa55fa5415d524200070d0d7aacfe'/>
<id>urn:sha1:cf2dff2b1e3fa55fa5415d524200070d0d7aacfe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use enum2&lt;_&gt; instead of enum&lt;_&gt; for Cpp-like debuginfo enum type names.</title>
<updated>2022-08-12T08:53:07+00:00</updated>
<author>
<name>Michael Woerister</name>
<email>michaelwoerister@posteo</email>
</author>
<published>2022-07-07T13:01:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=063ebfa5707015f895fc50c3a1dd70ab6867bc9b'/>
<id>urn:sha1:063ebfa5707015f895fc50c3a1dd70ab6867bc9b</id>
<content type='text'>
And add more comments about niche tag enum encoding.
</content>
</entry>
<entry>
<title>debuginfo: Change C++-like encoding for enums.</title>
<updated>2022-08-12T08:53:07+00:00</updated>
<author>
<name>Michael Woerister</name>
<email>michaelwoerister@posteo</email>
</author>
<published>2022-06-20T15:50:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=622da5d834e862112e860db1fc0404bd8604f578'/>
<id>urn:sha1:622da5d834e862112e860db1fc0404bd8604f578</id>
<content type='text'>
The updated encoding should be able to handle niche layouts where
more than one variant has fields.
</content>
</entry>
<entry>
<title>debuginfo: Refactor debuginfo generation for types -- Make generator-objects test case architecture independent.</title>
<updated>2022-03-15T10:45:51+00:00</updated>
<author>
<name>Michael Woerister</name>
<email>michaelwoerister@posteo</email>
</author>
<published>2022-03-15T10:45:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aa2408aa84cb3f758fbf572b1000ceea27fddb7f'/>
<id>urn:sha1:aa2408aa84cb3f758fbf572b1000ceea27fddb7f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>debuginfo: change cpp-like naming for generator environments so that NatVis works for them</title>
<updated>2022-03-14T15:52:47+00:00</updated>
<author>
<name>Michael Woerister</name>
<email>michaelwoerister@posteo</email>
</author>
<published>2022-03-03T11:10:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3ad299aa670face2085d2abec6e8481fa582068a'/>
<id>urn:sha1:3ad299aa670face2085d2abec6e8481fa582068a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>debuginfo: Make sure that type names for closure and generator environments are unique in debuginfo.</title>
<updated>2022-02-01T09:39:40+00:00</updated>
<author>
<name>Michael Woerister</name>
<email>michaelwoerister@posteo</email>
</author>
<published>2022-01-19T16:56:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fd7557b7ee454058fff84b556892adbef89f7d52'/>
<id>urn:sha1:fd7557b7ee454058fff84b556892adbef89f7d52</id>
<content type='text'>
Before this change, closure/generator environments coming from different
instantiations of the same generic function were all assigned the same
name even though they were distinct types with potentially different data
layout. Now we append the generic arguments of the originating function
to the type name.

This commit also emits '{closure_env#0}' as the name of these types in
order to disambiguate them from the accompanying closure function
'{closure#0}'. Previously both were assigned the same name.
</content>
</entry>
<entry>
<title>Store names of captured variables in `optimized_mir`</title>
<updated>2021-07-09T15:09:48+00:00</updated>
<author>
<name>lrh2000</name>
<email>lrh2000@pku.edu.cn</email>
</author>
<published>2021-05-15T11:01:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cda90f55419ce449f3a9db327465d9b2ae7dfce9'/>
<id>urn:sha1:cda90f55419ce449f3a9db327465d9b2ae7dfce9</id>
<content type='text'>
- Closures in external crates may get compiled in because of
  monomorphization. We should store names of captured variables
  in `optimized_mir`, so that they are written into the metadata
  file and we can use them to generate debuginfo.

- If there are breakpoints inside closures, the names of captured
  variables stored in `optimized_mir` can be used to print them.
  Now the name is more precise when disjoint fields are captured.
</content>
</entry>
<entry>
<title>Name the captured upvars for closures/generators in debuginfo</title>
<updated>2021-07-09T15:06:53+00:00</updated>
<author>
<name>lrh2000</name>
<email>lrh2000@pku.edu.cn</email>
</author>
<published>2021-05-05T15:50:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=29856acffeb87541bb167c33f4fdb13c31ba6de0'/>
<id>urn:sha1:29856acffeb87541bb167c33f4fdb13c31ba6de0</id>
<content type='text'>
Previously, debuggers print closures as something like
```
y::main::closure-0 (0x7fffffffdd34)
```
The pointer actually references to an upvar. It is not
very obvious, especially for beginners.

It's because upvars don't have names before, as they
are packed into a tuple. This commit names the upvars,
so we can expect to see something like
```
y::main::closure-0 {_captured_ref__b: 0x[...]}
```
</content>
</entry>
<entry>
<title>Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger</title>
<updated>2021-06-30T18:10:29+00:00</updated>
<author>
<name>Daniel Paoliello</name>
<email>danpao@microsoft.com</email>
</author>
<published>2021-06-24T17:36:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aac8a885520854e4b60ea5733b8b06f9e0cc1fcc'/>
<id>urn:sha1:aac8a885520854e4b60ea5733b8b06f9e0cc1fcc</id>
<content type='text'>
There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types).

Instead, each debug symbol name should be unique and useful:
* Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified.
* Qualify the principal trait for dynamic types.
* If there is no principal trait for a dynamic type, emit all other traits instead.
* Respect the `qualified` argument when emitting ref and pointer types.
* For implementations, emit the disambiguator.
* Print const generics when emitting generic parameters or arguments.

Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly:
* Avoid characters with special meaning (`#`, `[`, `"`, `+`).
* Never start a name with `&lt;` or `{` as this is treated as an operator.
* `&gt;&gt;` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this).
* Emit function declarations using C/C++ style syntax (e.g., leading return type).
* Emit arrays as a synthetic `array$&lt;type, size&gt;` type.
* Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).
</content>
</entry>
<entry>
<title>Remove artificial flag from generator variants</title>
<updated>2021-04-30T14:36:08+00:00</updated>
<author>
<name>lrh2000</name>
<email>lrh2000@pku.edu.cn</email>
</author>
<published>2021-04-30T12:02:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5bf989ece9e29941f2c517a39289a60bfb8595c0'/>
<id>urn:sha1:5bf989ece9e29941f2c517a39289a60bfb8595c0</id>
<content type='text'>
 - Literally, variants are not artificial. We have `yield` statements,
   upvars and inner variables in the source code.
 - Functionally, we don't want debuggers to suppress the variants. It
   contains the state of the generator, which is useful when debugging.
   So they shouldn't be marked artificial.
 - Debuggers may use artificial flags to find the active variant. In
   this case, marking variants artificial will make debuggers not work
   properly.

Fixes #79009.
</content>
</entry>
</feed>
