Skip to content

Commit 11c493a

Browse files
ehusstraviscross
authored andcommitted
Update debugger_visualizer to use the attribute template
1 parent f231c91 commit 11c493a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/attributes/debugger.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,27 @@ r[attributes.debugger.debugger_visualizer]
77
## The `debugger_visualizer` attribute
88

99
r[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.
1111
This 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+
1320
r[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
1632
r[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

Comments
 (0)