@@ -7,11 +7,27 @@ r[attributes.debugger.debugger_visualizer]
77## The ` debugger_visualizer ` attribute
88
99r[ attributes.debugger.debugger_visualizer.intro]
10- The * ` debugger_visualizer ` attribute* can be used to embed a debugger visualizer file into the debug information.
10+ The * ` debugger_visualizer ` [ attribute] [ attributes ] * can be used to embed a debugger visualizer file into the debug information.
1111This enables an improved debugger experience for displaying values in the debugger.
1212
13+ > [ !EXAMPLE]
14+ > <!-- ignore: requires external files-->
15+ > ``` rust,ignore
16+ > #![debugger_visualizer(natvis_file = "Example.natvis")]
17+ > #![debugger_visualizer(gdb_script_file = "example.py")]
18+ > ```
19+
1320r[attributes.debugger.debugger_visualizer.syntax]
14- It uses the [ MetaListNameValueStr] syntax to specify its inputs, and must be specified as a crate attribute.
21+ The `debugger_visualizer` attribute uses the [MetaListNameValueStr] syntax to specify its inputs. One of the following keys must be specified:
22+
23+ - [`natvis_file`][attributes.debugger.debugger_visualizer.natvis]
24+ - [`gdb_script_file`][attributes.debugger.debugger_visualizer.gdb]
25+
26+ r[attributes.debugger.debugger_visualizer.allowed-positions]
27+ The `debugger_visualizer` attribute may only be specified on a [module] or crate root.
28+
29+ r[attributes.debugger.debugger_visualizer.duplicates]
30+ Duplicate instances of the `debugger_visualizer` attribute will load all of the specified visualizers.
1531
1632r[attributes.debugger.debugger_visualizer.natvis]
1733### Using `debugger_visualizer` with Natvis
@@ -208,3 +224,4 @@ The `external` behavior is the default for macros that don't have this attribute
208224[ `-C collapse-macro-debuginfo` ] : ../../rustc/codegen-options/index.html#collapse-macro-debuginfo
209225[ `macro_rules` definition ] : ../macros-by-example.md
210226[ attribute ] : ../attributes.md
227+ [ module ] : ../items/modules.md
0 commit comments