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 bundled GDB pretty-printers #3045

Merged
merged 5 commits into from
Feb 13, 2019
Merged

Conversation

artemmukhin
Copy link
Member

@artemmukhin artemmukhin commented Nov 16, 2018

Add bundled GDB pretty-printers.

Now it supports:

  • struct, tuple
  • str, String, OsString (with UTF-8 support)
  • Vec, VecDeque
  • BTreeSet, BTreeMap (thanks, @tromey!)
  • Rc, Arc
  • Cell, Ref, RefMut, RefCell

Fixes #3357

There are some problems with enums because of wrong DWARF codes in rustc's codegen (it affects default rustc pretty-printers too); I'm going to fix it after the next rustc release.

screenshot 2018-11-19 at 11 54 56

screenshot 2018-11-19 at 11 54 16

screenshot 2018-11-27 at 19 04 44

screenshot 2018-11-27 at 19 00 47

screenshot 2018-11-29 at 18 56 55

@artemmukhin artemmukhin force-pushed the debugger-gdb branch 3 times, most recently from d399d31 to e4f55be Compare November 19, 2018 08:05
@artemmukhin artemmukhin changed the title WIP: Add GDB pretty-printers Add GDB pretty-printers Nov 19, 2018
@artemmukhin artemmukhin requested a review from Undin November 19, 2018 08:07
@artemmukhin artemmukhin force-pushed the debugger-gdb branch 2 times, most recently from 44a6a25 to 846129c Compare November 22, 2018 14:25
@artemmukhin artemmukhin force-pushed the debugger-gdb branch 2 times, most recently from 04a0f5b to 58223e5 Compare November 29, 2018 15:54
@tromey
Copy link

tromey commented Nov 29, 2018

There are some problems with enums because of wrong DWARF codes in rustc's codegen

See rust-lang/rust#54004. If there's a bug, I definitely want to know about it -- but I suspect instead what is happening is that the new debuginfo is confusing the pretty-printers. gdb 8.2 understands the new DWARF and consequently I disabled some of the default pretty-printers in rust-lang/rust#55767.

@tromey
Copy link

tromey commented Nov 29, 2018

... also I wonder if I need to fix https://sourceware.org/bugzilla/show_bug.cgi?id=20163, to allow varobjs to work better with rust enums.

@artemmukhin
Copy link
Member Author

@tromey Actually, I meant that the stable Rust toolchain has some problems. I'm aware of your progress on DWARF generation and it looks great on gdb 8.2 with Rust nightly. Consider such code:

enum E { A, B(i32, i32), C { x: i32, y: i32, z: i32} }
let a = E::A;
let b = E::B(42, 123);
let c = E::C { x: 10, y: 20, z: 30 };

gdb 8.2 (without any pretty-printers) prints this enum correctly:

(gdb) p a
$2 = my::E::A
(gdb) p b
$1 = my::E::B(42, 123)
(gdb) p c
$3 = my::E::C{x: 10, y: 20, z: 30}

However, CLion's output is not as good:
screenshot 2018-11-30 at 19 01 39
Would you happen to know why that might be? Maybe CLion (and probably other Rust IDEs) needs to support some new gdb features related to discriminated unions?

@tromey
Copy link

tromey commented Nov 30, 2018

Maybe CLion (and probably other Rust IDEs) needs to support some new gdb features related to discriminated unions?

Assuming CLion is using MI varobjs (I didn't look so I don't know...) then it is that gdb bug I mentioned earlier -- basically varobj has to be taught a bit about discriminated unions.

@artemmukhin
Copy link
Member Author

@tromey OK, I will be watching this gdb bug, thanks!

@Undin
Copy link
Member

Undin commented Jan 21, 2019

@ortem Could you rebase onto master?

@artemmukhin artemmukhin force-pushed the debugger-gdb branch 2 times, most recently from 0a362a3 to ca7266e Compare January 22, 2019 09:10
@artemmukhin artemmukhin changed the title Add GDB pretty-printers WIP: Add GDB pretty-printers Jan 29, 2019
@artemmukhin artemmukhin force-pushed the debugger-gdb branch 10 times, most recently from 5ea24e8 to 0c908ee Compare January 31, 2019 11:08
@artemmukhin artemmukhin force-pushed the debugger-gdb branch 3 times, most recently from da9fd88 to 3fb3fc4 Compare February 1, 2019 13:10
@artemmukhin
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Feb 4, 2019
@bors
Copy link
Contributor

bors bot commented Feb 4, 2019

try

Build failed

@artemmukhin artemmukhin force-pushed the debugger-gdb branch 5 times, most recently from 58faaa5 to e8d79ec Compare February 13, 2019 09:21
@artemmukhin artemmukhin changed the title WIP: Add GDB pretty-printers Add bundled GDB pretty-printers Feb 13, 2019
.travis.yml Outdated Show resolved Hide resolved
@artemmukhin
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Feb 13, 2019
3045: Add bundled GDB pretty-printers r=ortem a=ortem

Add bundled GDB pretty-printers.

Now it supports:
* struct, tuple
* `str`, `String`, `OsString` (with UTF-8 support)
* `Vec`, `VecDeque`
* `BTreeSet`, `BTreeMap` (thanks, @tromey!)
* `Rc`, `Arc`
* `Cell`, `Ref`, `RefMut`, `RefCell`

Fixes #3357 

There are some problems with enums because of wrong DWARF codes in rustc's codegen (it affects default rustc pretty-printers too); I'm going to fix it after the next rustc release.

<img width="229" alt="screenshot 2018-11-19 at 11 54 56" src="https://user-images.githubusercontent.com/4854600/48693722-7524fb80-ebeb-11e8-84f7-7fa7fee1f676.png">
<img width="382" alt="screenshot 2018-11-19 at 11 54 16" src="https://user-images.githubusercontent.com/4854600/48693735-7f46fa00-ebeb-11e8-8a04-b24b7f29dd85.png">

<img width="240" alt="screenshot 2018-11-27 at 19 04 44" src="https://user-images.githubusercontent.com/4854600/49094466-65ef1f00-f277-11e8-9c4b-c094ab4bcc0b.png">
<img width="247" alt="screenshot 2018-11-27 at 19 00 47" src="https://user-images.githubusercontent.com/4854600/49094327-101a7700-f277-11e8-9f11-862e57d1a525.png">

<img width="495" alt="screenshot 2018-11-29 at 18 56 55" src="https://user-images.githubusercontent.com/4854600/49234170-9914e800-f408-11e8-95e4-bce19608fed2.png">



Co-authored-by: ortem <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 13, 2019

Build failed

@artemmukhin
Copy link
Member Author

bors retry

bors bot added a commit that referenced this pull request Feb 13, 2019
3045: Add bundled GDB pretty-printers r=ortem a=ortem

Add bundled GDB pretty-printers.

Now it supports:
* struct, tuple
* `str`, `String`, `OsString` (with UTF-8 support)
* `Vec`, `VecDeque`
* `BTreeSet`, `BTreeMap` (thanks, @tromey!)
* `Rc`, `Arc`
* `Cell`, `Ref`, `RefMut`, `RefCell`

Fixes #3357 

There are some problems with enums because of wrong DWARF codes in rustc's codegen (it affects default rustc pretty-printers too); I'm going to fix it after the next rustc release.

<img width="229" alt="screenshot 2018-11-19 at 11 54 56" src="https://user-images.githubusercontent.com/4854600/48693722-7524fb80-ebeb-11e8-84f7-7fa7fee1f676.png">
<img width="382" alt="screenshot 2018-11-19 at 11 54 16" src="https://user-images.githubusercontent.com/4854600/48693735-7f46fa00-ebeb-11e8-8a04-b24b7f29dd85.png">

<img width="240" alt="screenshot 2018-11-27 at 19 04 44" src="https://user-images.githubusercontent.com/4854600/49094466-65ef1f00-f277-11e8-9c4b-c094ab4bcc0b.png">
<img width="247" alt="screenshot 2018-11-27 at 19 00 47" src="https://user-images.githubusercontent.com/4854600/49094327-101a7700-f277-11e8-9f11-862e57d1a525.png">

<img width="495" alt="screenshot 2018-11-29 at 18 56 55" src="https://user-images.githubusercontent.com/4854600/49234170-9914e800-f408-11e8-95e4-bce19608fed2.png">



3397: Fix Incorrect CachedValue use report on 2019.1 r=vlad20012 a=vlad20012

2019.1 platform brings dynamic analyzer of incorrect CachedValue usages, which generate crashes on EAPs. This case is false positive, but it's easy to "fix" it anyway, so let's do it.

bors r+

3398: RUN: Apply `Offline mode` option not only to `cargo build` but also to `cargo check` r=mchernyavsky a=mchernyavsky



Co-authored-by: ortem <[email protected]>
Co-authored-by: vlad20012 <[email protected]>
Co-authored-by: mchernyavsky <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 13, 2019

Build failed (retrying...)

bors bot added a commit that referenced this pull request Feb 13, 2019
3045: Add bundled GDB pretty-printers r=ortem a=ortem

Add bundled GDB pretty-printers.

Now it supports:
* struct, tuple
* `str`, `String`, `OsString` (with UTF-8 support)
* `Vec`, `VecDeque`
* `BTreeSet`, `BTreeMap` (thanks, @tromey!)
* `Rc`, `Arc`
* `Cell`, `Ref`, `RefMut`, `RefCell`

Fixes #3357 

There are some problems with enums because of wrong DWARF codes in rustc's codegen (it affects default rustc pretty-printers too); I'm going to fix it after the next rustc release.

<img width="229" alt="screenshot 2018-11-19 at 11 54 56" src="https://user-images.githubusercontent.com/4854600/48693722-7524fb80-ebeb-11e8-84f7-7fa7fee1f676.png">
<img width="382" alt="screenshot 2018-11-19 at 11 54 16" src="https://user-images.githubusercontent.com/4854600/48693735-7f46fa00-ebeb-11e8-8a04-b24b7f29dd85.png">

<img width="240" alt="screenshot 2018-11-27 at 19 04 44" src="https://user-images.githubusercontent.com/4854600/49094466-65ef1f00-f277-11e8-9c4b-c094ab4bcc0b.png">
<img width="247" alt="screenshot 2018-11-27 at 19 00 47" src="https://user-images.githubusercontent.com/4854600/49094327-101a7700-f277-11e8-9f11-862e57d1a525.png">

<img width="495" alt="screenshot 2018-11-29 at 18 56 55" src="https://user-images.githubusercontent.com/4854600/49234170-9914e800-f408-11e8-95e4-bce19608fed2.png">



3398: RUN: Apply `Offline mode` option not only to `cargo build` but also to `cargo check` r=mchernyavsky a=mchernyavsky



Co-authored-by: ortem <[email protected]>
Co-authored-by: mchernyavsky <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 13, 2019

Build succeeded

@bors bors bot merged commit c257c9b into intellij-rust:master Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugger displays incorrect values for strings
4 participants