Commit Graph

1648 Commits

Author SHA1 Message Date
Markus Westerlind 81c9a02018 Update HashSet natvis 2021-03-17 10:07:09 +01:00
Markus Westerlind 7cf8d3ac2b feat: Update hashbrown to instantiate less llvm IR
Includes https://github.com/rust-lang/hashbrown/pull/204 and https://github.com/rust-lang/hashbrown/pull/205 (not yet merged) which both server to reduce the amount of IR generated for hashmaps.

Inspired by the llvm-lines data gathered in https://github.com/rust-lang/rust/pull/76680
2021-03-16 11:20:26 +01:00
Dylan DPC 298c31b04a
Rollup merge of #82557 - rylev:natvis-improvements, r=varkor
Add natvis for Result, NonNull, CString, CStr, and Cow

This adds natvis support (used for Windows debugging) to the following types: `Result`, `NonNull`, `CString`, `CStr`, and `Cow`.
2021-03-08 13:13:20 +01:00
David Tolnay bd51dea693
Change twice used large const table to static
This table is used twice in core::num::dec2flt::algorithm::power_of_ten.
According to the semantics of const, a separate huge definition of the
table is inlined at both places.

    fn power_of_ten(e: i16) -> Fp {
        assert!(e >= table::MIN_E);
        let i = e - table::MIN_E;
        let sig = table::POWERS.0[i as usize];
        let exp = table::POWERS.1[i as usize];
        Fp { f: sig, e: exp }
    }

Theoretically this gets cleaned up by optimization passes, but in
practice I am experiencing a miscompile from LTO on this code. Making
the table a static, which would only be defined a single time and not
require attention from LTO, eliminates the miscompile and seems
semantically more appropriate anyway. A separate bug report on the LTO
bug is forthcoming.
2021-03-01 10:41:16 -08:00
Ryan Levick 920e2d8248 Add natvis for Result, NonNull, CString, CStr, and Cow 2021-03-01 10:57:36 +01:00
katelyn martin f06896ca7a
fix typo in `pre-commit.sh` 2021-02-24 18:37:13 -05:00
Dylan DPC 641c3785dc
Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514
[rustdoc-json] Make `header` a vec of modifiers, and FunctionPointer consistent

Bumps version number and adds tests, this is a breaking change. I can split this into two (`is_unsafe` -> `header` and `header: Vec<Modifiers>`) if desired.

Rationale: Modifiers are individual notes on a function, it makes more sense for them to be a list of an independent enum over a String which is inconsistently exposing the HIR representation (prefix_str vs custom literals).
Function pointers currently only support `unsafe`, but there has been talk on and off about allowing them to also support `const`, and this makes handling their modifiers consistent with handling those of a function, allowing better shared code.

`@rustbot` modify labels: +A-rustdoc-json +T-rustdoc
CC: `@HeroicKatora`
r? `@jyn514`
2021-02-14 16:54:45 +01:00
Rune Tynan a26fa74d3c
Make `header` a vec of modifiers, make FunctionPointer consistent with Function and Method. 2021-02-08 14:00:30 -05:00
ortem 9ce070d27d Resolve typedef in HashMap lldb pretty-printer only if possible
Previously, `GetTypedefedType` was invoked unconditionally.
But this did not work in case of `rust-lldb` without Rust patches
since there was no typedef actually.
2021-02-06 20:24:07 +03:00
Rune Tynan 7715656edd
Add jsondocck tool, and use it for rustdoc JSON 2021-01-19 14:24:25 -05:00
Guillaume Gomez da3eef61f5 Detect invalid rustdoc test commands 2021-01-03 13:53:11 +01:00
Yuki Okushi 88b198b727
Rollup merge of #80311 - sivadeilra:natvis, r=petrochenkov
Improvements to NatVis support

NatVis files describe how to display types in some Windows debuggers,
such as Visual Studio, WinDbg, and VS Code.

This commit makes several improvements:

* Adds visualizers for Rc<T>, Weak<T>, and Arc<T>.

* Changes [size] to [len], for consistency with the Rust API.
  Visualizers often use [size] to mirror the size() method on C++ STL
  collections.

* Several visualizers used the PVOID and ULONG typedefs. These are part
  of the Windows API; they are not guaranteed to always be defined in a
  pure Rust DLL/EXE. I converted PVOID to `void*` and `ULONG` to
  `unsigned long`.

* Cosmetic change: Removed {} braces around the visualized display
  for `Option` types. They now display simply as `Some(value)` or
  `None`, which reflects what is written in source code.

* The visualizer for `alloc::string::String` makes assumptions about
  the layout of `String` (it casts `String*` to another type), rather
  than using symbolic expressions. This commit changes the visualizer
  so that it simply uses symbolic expressions to access the string
  data and string length.

* The visualizers for `str` and `String` now place the character data
  array under a synthetic `[chars]` node. When expanding a `String`
  node, users rarely want to see an array of characters. This just places
  them behind one expansion node / level.
2020-12-30 22:49:19 +09:00
Vadim Petrochenkov 4d2d0bad4e Remove `compile-fail` test suite 2020-12-29 23:39:56 +03:00
Arlie Davis 2f584229d4 Improvements to NatVis support
NatVis files describe how to display types in some Windows debuggers,
such as Visual Studio, WinDbg, and VS Code.

This commit makes several improvements:

* Adds visualizers for Rc<T>, Weak<T>, and Arc<T>.

* Changes [size] to [len], for consistency with the Rust API.
  Visualizers often use [size] to mirror the size() method on C++ STL
  collections.

* Several visualizers used the PVOID and ULONG typedefs. These are part
  of the Windows API; they are not guaranteed to always be defined in a
  pure Rust DLL/EXE. I converted PVOID to `void*` and `ULONG` to
  `unsigned long`.

* Cosmetic change: Removed {} braces around the visualized display
  for `Option` types. They now display simply as `Some(value)` or
  `None`, which reflects what is written in source code.

* The visualizer for `alloc::string::String` makes assumptions about
  the layout of `String` (it casts `String*` to another type), rather
  than using symbolic expressions. This commit changes the visualizer
  so that it simply uses symbolic expressions to access the string
  data and string length.
2020-12-28 12:14:49 -08:00
bors 92e4fb0732 Auto merge of #79235 - ortem:fix-btreemap-gdb-pretty-printer, r=Mark-Simulacrum
Fix zero-sized BTreeMap gdb pretty-printer

`gdb.parse_and_eval("()")` is needed because GDB treats "()" as a Rust array of two characters, not as a unit

Based on https://github.com/intellij-rust/intellij-rust/pull/6356
2020-12-02 04:12:33 +00:00
Jonas Schievink 93d830ed50
Rollup merge of #79234 - ortem:fix-hashmap-pretty-printers, r=Mark-Simulacrum
Resolve typedefs in HashMap gdb/lldb pretty-printers

`GetTypedefedType` (LLDB) and `strip_typedefs` (GDB) calls are needed to resolve key and value types completely.
Without these calls, debugger doesn't show the actual type.

**Before** (without `GetTypedefedType`):
```
(lldb) frame variable hm[0]
(T) hm[0] = { ... }
```

**After** (with `GetTypedefedType`):
```
(lldb) frame variable hm[0]
((i32, alloc::string::String)) hm[0] = { ... }
```

Based on https://github.com/intellij-rust/intellij-rust/pull/6258
2020-11-28 15:58:17 +01:00
Stein Somers 8526c313c1 BTreeMap: cut out the ceremony around BoxedNode 2020-11-23 17:02:08 +01:00
ortem 685e1f3e45 Fix zero-sized BTreeMap gdb pretty-printer
`gdb.parse_and_eval("()")` is needed because GDB treats "()" as a Rust array of two characters, not as a unit
2020-11-23 17:07:14 +03:00
ortem 905ed3bb6b Resolve typedefs in HashMap gdb/lldb pretty-printers
`GetTypedefedType` (LLDB) and `strip_typedefs` (GDB) calls are needed to resolve key and value types completely.
Without these calls, debugger doesn't show the actual type.

* Before (without `GetTypedefedType`):
(lldb) frame variable hm[0]
(T) hm[0] = { ... }

* After (with `GetTypedefedType`):
(lldb) frame variable hm[0]
((i32, alloc::string::String)) hm[0] = { ... }
2020-11-20 17:54:57 +03:00
Stein Somers 9fca57ceb9 BTreeMap: reuse NodeRef as Root, keep BoxedNode for edges only, ban Unique 2020-11-18 10:07:42 +01:00
Pietro Albini c32de757cd
lldb_batchmode: show more error information
Even more information to try and debug #78665.
2020-11-03 12:01:46 +01:00
Stein Somers 28af355b9f BTreeMap: improve gdb introspection of BTreeMap with ZST keys or values 2020-10-14 13:03:23 +02:00
Dylan DPC 9c365a2561
Rollup merge of #77788 - ssomers:btree_cleanup_gdb, r=Mark-Simulacrum
BTreeMap: fix gdb provider on BTreeMap with ZST keys or values

Avoid error when gdb is asked to inspect a BTreeMap or BTreeSet with a zero-sized type as key or value. And clean up.

r? @Mark-Simulacrum
2020-10-14 02:30:36 +02:00
Stein Somers bb9da7a0ed BTreeMap: fix gdb introspection of BTreeMap with ZST keys or values 2020-10-10 15:27:51 +02:00
bors be719d11e5 Auto merge of #77609 - ortem:fix-lldb-commands, r=Mark-Simulacrum
Remove redundant backslashes from `lldb_commands`
2020-10-09 15:18:41 +00:00
Joshua Nelson f4989494bf Unset GIT_DIR in pre-commit hook
Works around https://github.com/rust-lang/rust/issues/77620
2020-10-07 19:50:27 -04:00
ortem 4f792d6b88 Remove redundant backslashes from `lldb_commands` 2020-10-06 11:57:51 +03:00
Cassandra Fridkin 68ca4742c5
Clean up pre-commit.sh 2020-10-05 19:35:06 -04:00
Cassandra Fridkin 7de557bf9c
Move script to src/etc 2020-10-05 18:57:48 -04:00
Matt Brubeck ebd15e790a Implement HashSet in terms of hashbrown::HashSet 2020-09-08 17:24:23 -07:00
MaulingMonkey 5acd272f5f Fix HashMap visualizers in Visual Studio (Code)
CDB doesn't care that you're using static_cast between unrelated types.
VS(C) does.  These should've been reinterpret_cast or C casts.
Cast is from e.g. `u8*` to `tuple<$T1, $T2>*`
2020-09-05 14:50:03 -07:00
ortem 9cdcfe2288 Fix loading pretty-printers in rust-lldb script 2020-08-28 09:29:45 +03:00
MaulingMonkey 122c03745e Handle new HashMap layout in CDB, MSVC, WinDbg, etc. 2020-08-07 07:03:15 +01:00
Amanieu d'Antras e3283e0331 Handle new HashMap layout in GDB and LLDB 2020-08-07 07:03:15 +01:00
Lzu Tao a4757225d7 Run all tests if have no specified tests 2020-07-31 04:20:27 +00:00
Lzu Tao 0374006d79 Avoid bool-like naming 2020-07-29 10:48:00 +00:00
jnozsc db4e9722bf python codes cleanup 2020-07-26 09:56:12 -07:00
Manish Goregaokar 084ac77cf2
Rollup merge of #73715 - MaulingMonkey:pr-natvis-tuples, r=Amanieu
debuginfo:  Mangle tuples to be natvis friendly, typedef basic types

These changes are meant to unblock rust-lang/rust#70052 "Update hashbrown to 0.8.0" by allowing the use of `tuple<u64, u64>` as a .natvis expression in MSVC style debuggers (MSVC, WinDbg, CDB, etc.)

* f8eb81b does the actual mangling of `(u64, u64)` -> `tuple<u64, 64>`
* 24a728a allows `u64` to resolve (fixing `$T1` / `$T2` when used to visualize `HashMap<u64, u64, ...>`)
2020-07-11 08:53:13 -07:00
Tamir Duberstein 62cf767a4a
Avoid "whitelist"
Other terms are more inclusive and precise.
2020-07-10 07:39:28 -04:00
Manish Goregaokar df8f551e79
Rollup merge of #73140 - tmiasko:element-tree, r=GuillaumeGomez
Fallback to xml.etree.ElementTree

The xml.etree.cElementTree has been deprecated since Python 3.3
and removed in Python 3.9 https://bugs.python.org/issue36543.
2020-07-03 17:16:50 -07:00
Manish Goregaokar fb976e65a0
Rollup merge of #72569 - ChrisDenton:remove-innosetup, r=nikomatsakis
Remove legacy InnoSetup GUI installer

On Windows the InnoSetup `.exe` installer was superseded by the MSI installer long ago. It's no longer needed.

The `.exe` installer hasn't been linked from the [other installation methods](https://forge.rust-lang.org/infra/other-installation-methods.html#standalone) page in many years. As far as I can tell the intent was always to remove this installer once the MSI proved itself. Though admittedly both installers feel very "legacy" at this point.

Removing this would mean we only maintain one Windows GUI installer and would speed up the distribution phase.

As a result of removing InnoSetup, this closes #24397
2020-07-01 20:35:41 -07:00
MaulingMonkey f8eb81ba4e Modify type names on MSVC to make tuples .natvis compatible.
- Mangles (T0, T1) as tuple<T0, T1>, possibly unblocking rust-lang/rust#70052 "Update hashbrown to 0.8.0"
- Prettifies Rust tuples similar to VS2017's std::tuple
- Improves debuginfo test coverage
2020-06-24 19:28:12 -07:00
ortem 47c26e69a9 Implement new gdb/lldb pretty-printers
Replace old GDB and LLDB pretty-printers with new ones
which were originally written for IntelliJ Rust.
New LLDB pretty-printers support synthetic children.
New GDB/LLDB pretty-printers support all Rust types
supported by old pretty-printers, and also support:
Rc, Arc, Cell, Ref, RefCell, RefMut, HashMap, HashSet.
2020-06-09 16:13:11 +03:00
Tomasz Miąsko 291dce91b2 Fallback to xml.etree.ElementTree
The xml.etree.cElementTree has been deprecated since Python 3.3
and removed in Python 3.9 https://bugs.python.org/issue36543.
2020-06-08 20:35:56 +02:00
Chris Denton 912963bd08 Remove legacy InnoSetup GUI installer
On Windows the InnoSetup installer was superseded by the MSI installer. It's no longer needed.
2020-05-25 13:53:02 +01:00
Guillaume Gomez 38eb369fa4 Enforce Python 3 as much as possible 2020-04-10 09:09:58 -04:00
Mazdak Farrokhzad 4911d168d8
Rollup merge of #70713 - jsgf:rust-gdb-rustc, r=Mark-Simulacrum
Prefer sysroot from rustc in same directory as rust-gdb

If there isn't a rustc in the same directory, then fall back to searching
the path.
2020-04-06 04:24:18 +02:00
Linus Färnstrand d0fc5d9e6b Stop importing int module in float parse test 2020-04-05 11:22:01 +02:00
Jeremy Fitzhardinge 7a824c8598 Prefer sysroot from rustc in same directory as rust-gdb
If there isn't a rustc in the same directory, then fall back to searching
the path.
2020-04-02 11:52:35 -07:00
Eduard-Mihai Burtescu 8deff18529 tests: remove ignore directives from tests that mention core/alloc/std spans. 2020-04-02 11:48:34 +03:00