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

Add documentation for debugger_visualizer attribute #1335

Merged
merged 10 commits into from May 22, 2023

Conversation

gibbyfree
Copy link
Contributor

This PR adds documentation for the debugger_visualizer attribute (Tracking issue for debugger_visualizer rust#95939). These docs describe use of the attribute with NatVis (Add a new Rust attribute to support embedding debugger visualizers rust#91779) and pretty printers (Add support for embedding pretty printers via #[debugger_visualizer] attribute rust#97028).

@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Mar 2, 2023
@@ -0,0 +1,158 @@
# Debugger attributes

he following [attributes] are used for enhancing the debugging experience when using third-party debuggers like GDB or LLDB.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo


### Using `debugger_visualizer` with Natvis

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: missing end paren

1. Launch GDB with extra arguments to explicitly add a directory or binary to the auto-load safe path: `gdb -iex "set auto-load safe-path path/to/binary" path/to/binary` (For more information, see GDB's [auto-loading documentation])
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`.

Consider a crate called `foobar` with this directory structure:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use foobar

@gibbyfree gibbyfree marked this pull request as ready for review March 6, 2023 20:08
src/attributes/debugger.md Outdated Show resolved Hide resolved
@ehuss
Copy link
Contributor

ehuss commented May 6, 2023

I applied some updates to the text. A rough overview of the changes:

  • General edits to maintain the correct style for the reference and consistency.
  • Added more specifics.
  • Removed mention of LLDB since it doesn't support LLDB AFAIK.
  • Removed mentions of Cargo and rustc. The reference tries to focus on specifically the Rust language.
  • Simplified the examples to focus on the bare minimum.
  • Fixed some errors in the examples (like the natvis type path was missing the module).
  • Added a print statement that one can break on. AFAIK you can't break on ().
  • Switched suggestion of set auto-load safe-path to add-auto-load-safe-path, since the former seems to break rust-gdb.

@ehuss ehuss merged commit f30520a into rust-lang:master May 22, 2023
1 check passed
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 23, 2023
Update books

## rust-embedded/book

1 commits in d9eb4c3f75435b008881062ffa77bf0d1527b37d..f2aed2fe8e9f55508c86ba3aa4b6789b18a08a22
2023-05-12 12:26:37 UTC to 2023-05-12 12:26:37 UTC

- Add link to Comprehensive Rust 🦀 (rust-embedded/book#354)

## rust-lang/nomicon

2 commits in b5f7500fc40775096c2bbd204eae096612cf9047..b5f018fb5930cb733b0a8aaf2eed975d4771e74d
2023-05-19 18:10:25 UTC to 2023-05-14 20:22:16 UTC

- Expand unbounded lifetime example code and improve wording (rust-lang/nomicon#408)
- Update to 2021 edition (rust-lang/nomicon#410)

## rust-lang/reference

5 commits in 28dc0f3576b55f5e57c5d6e65cd68ba3161e9fd5..553d99b02a53b4133a40d5bd2e19958c67487c00
2023-05-22 10:50:07 UTC to 2023-05-10 01:54:07 UTC

- Update raw-dylib documentation for stabilization (rust-lang/reference#1345)
- fix a typo (rust-lang/reference#1359)
- fixed minor error in a comment that annotated output of a proc macro (rust-lang/reference#1358)
- Fix example code in `impl` docs (rust-lang/reference#1360)
- Add documentation for debugger_visualizer attribute (rust-lang/reference#1335)

## rust-lang/rustc-dev-guide

4 commits in 28dbeaf5c44bc7f5111ad412e99f2d7c5cec6c90..f1e637883fafeb83bdd5906ee7f467e4d35b7337
2023-05-18 02:44:05 UTC to 2023-05-11 09:59:23 UTC

- Add note about shell completion scripts (rust-lang/rustc-dev-guide#1686)
- filter out S-blocked issues in the "Getting Started" search (rust-lang/rustc-dev-guide#1687)
- Rename InstCombine to InstSimplify (rust-lang/rustc-dev-guide#1684)
- Use unpretty for debugging Hir (rust-lang/rustc-dev-guide#1685)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants