Skip to content

Commit 2551932

Browse files
committed
Revise debugger_visualizer text
1 parent 11c493a commit 2551932

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/attributes/debugger.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ r[attributes.debugger]
33

44
The following [attributes] are used for enhancing the debugging experience when using third-party debuggers like GDB or WinDbg.
55

6+
<!-- template:attributes -->
67
r[attributes.debugger.debugger_visualizer]
78
## The `debugger_visualizer` attribute
89

910
r[attributes.debugger.debugger_visualizer.intro]
10-
The *`debugger_visualizer` [attribute][attributes]* can be used to embed a debugger visualizer file into the debug information.
11-
This enables an improved debugger experience for displaying values in the debugger.
11+
The *`debugger_visualizer` [attribute][attributes]* can be used to embed a debugger visualizer file into the debug information. This improves the debugger experience when displaying values.
1212

1313
> [!EXAMPLE]
1414
> <!-- ignore: requires external files-->
@@ -24,26 +24,25 @@ The `debugger_visualizer` attribute uses the [MetaListNameValueStr] syntax to sp
2424
- [`gdb_script_file`][attributes.debugger.debugger_visualizer.gdb]
2525
2626
r[attributes.debugger.debugger_visualizer.allowed-positions]
27-
The `debugger_visualizer` attribute may only be specified on a [module] or crate root.
27+
The `debugger_visualizer` attribute may only be applied to a [module] or to the crate root.
2828
2929
r[attributes.debugger.debugger_visualizer.duplicates]
30-
Duplicate instances of the `debugger_visualizer` attribute will load all of the specified visualizers.
30+
The `debugger_visualizer` attribute may be used any number of times on a form. All specified visualizer files will be loaded.
3131
3232
r[attributes.debugger.debugger_visualizer.natvis]
3333
### Using `debugger_visualizer` with Natvis
3434
3535
r[attributes.debugger.debugger_visualizer.natvis.intro]
36-
Natvis is an XML-based framework for Microsoft debuggers (such as Visual Studio and WinDbg) that uses declarative rules to customize the display of types.
37-
For detailed information on the Natvis format, refer to Microsoft's [Natvis documentation].
36+
Natvis is an XML-based framework for Microsoft debuggers (such as Visual Studio and WinDbg) that uses declarative rules to customize the display of types. For detailed information on the Natvis format, refer to Microsoft's [Natvis documentation].
3837
3938
r[attributes.debugger.debugger_visualizer.natvis.msvc]
4039
This attribute only supports embedding Natvis files on `-windows-msvc` targets.
4140
4241
r[attributes.debugger.debugger_visualizer.natvis.path]
43-
The path to the Natvis file is specified with the `natvis_file` key, which is a path relative to the crate source file.
42+
The path to the Natvis file is specified with the `natvis_file` key, which is a path relative to the source file.
4443
4544
> [!EXAMPLE]
46-
> <!-- ignore: requires external files, and msvc -->
45+
> <!-- ignore: requires external files and msvc -->
4746
> ```rust ignore
4847
> #![debugger_visualizer(natvis_file = "Rectangle.natvis")]
4948
>
@@ -60,7 +59,7 @@ The path to the Natvis file is specified with the `natvis_file` key, which is a
6059
> }
6160
> ```
6261
>
63-
> and `Rectangle.natvis` contains:
62+
> `Rectangle.natvis` contains:
6463
>
6564
> ```xml
6665
> <?xml version="1.0" encoding="utf-8"?>
@@ -100,17 +99,18 @@ r[attributes.debugger.debugger_visualizer.gdb]
10099
### Using `debugger_visualizer` with GDB
101100
102101
r[attributes.debugger.debugger_visualizer.gdb.pretty]
103-
GDB supports the use of a structured Python script, called a *pretty printer*, that describes how a type should be visualized in the debugger view.
104-
For detailed information on pretty printers, refer to GDB's [pretty printing documentation].
102+
GDB supports the use of a structured Python script, called a *pretty printer*, that describes how a type should be visualized in the debugger view. For detailed information on pretty printers, refer to GDB's [pretty printing documentation].
105103
106-
Embedded pretty printers are not automatically loaded when debugging a binary under GDB.
107-
There are two ways to enable auto-loading embedded pretty printers:
108-
1. Launch GDB with extra arguments to explicitly add a directory or binary to the auto-load safe path: `gdb -iex "add-auto-load-safe-path safe-path path/to/binary" path/to/binary`
109-
For more information, see GDB's [auto-loading documentation].
110-
1. Create a file named `gdbinit` under `$HOME/.config/gdb` (you may need to create the directory if it doesn't already exist). Add the following line to that file: `add-auto-load-safe-path path/to/binary`.
104+
> [!NOTE]
105+
> Embedded pretty printers are not automatically loaded when debugging a binary under GDB.
106+
>
107+
> There are two ways to enable auto-loading embedded pretty printers:
108+
>
109+
> 1. Launch GDB with extra arguments to explicitly add a directory or binary to the auto-load safe path: `gdb -iex "add-auto-load-safe-path safe-path path/to/binary" path/to/binary` For more information, see GDB's [auto-loading documentation].
110+
> 1. Create a file named `gdbinit` under `$HOME/.config/gdb` (you may need to create the directory if it doesn't already exist). Add the following line to that file: `add-auto-load-safe-path path/to/binary`.
111111
112112
r[attributes.debugger.debugger_visualizer.gdb.path]
113-
These scripts are embedded using the `gdb_script_file` key, which is a path relative to the crate source file.
113+
These scripts are embedded using the `gdb_script_file` key, which is a path relative to the source file.
114114
115115
> [!EXAMPLE]
116116
> <!-- ignore: requires external files -->
@@ -128,7 +128,7 @@ These scripts are embedded using the `gdb_script_file` key, which is a path rela
128128
> }
129129
> ```
130130
>
131-
> and `printer.py` contains:
131+
> `printer.py` contains:
132132
>
133133
> ```python
134134
> import gdb

0 commit comments

Comments
 (0)