about summary refs log tree commit diff
path: root/src/etc/gdb_rust_pretty_printing.py
AgeCommit message (Collapse)AuthorLines
2020-06-09Implement new gdb/lldb pretty-printersortem-466/+0
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-03-26Test and fix gdb pretty printing againStein Somers-2/+2
2020-03-21Test pretty printing more and fix overzealous type substitutionStein Somers-1/+1
2020-03-20Fix debugger pretty printing of BTreesMark Rousskov-13/+21
2020-02-08PEP8 format spacingChris Simpkins-20/+23
2019-11-20made gdb pretty-printing script more robust when printing uninitialized vec.Felix S. Klock II-1/+11
I based this solution on my reading of: https://rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers#what-is-still-to-be-done That post claims that there is no clean way to check for garbage pointers, and so this PR adopts the same solution of tentatively attempting to convert a dererence to a string, which throws a clean exception on garbage that we can catch and recover from. I only made the change to vec and not the other pretty printers because I wanted to focus my effort on the simplest thing that would resolve issue #64343. In particular, I *considered* generalizing this fix to work on the other datatypes in the pretty-printing support library, but I don't want to invest effort in that until after we resolve our overall debugging support strategy; see also issues #60826 and #65564.
2019-01-28fix gdb debug printingRalf Jung-5/+6
2019-01-15[rust-gdb] relax the GDB version regexJosh Stone-1/+1
The pretty-printer script is checking `gdb.VERSION` to see if it's at least 8.1 for some features. With `re.match`, it will only find the version at the beginning of that string, but in Fedora the string is something like "Fedora 8.2-5.fc29". Using `re.search` instead will find the first location that matches anywhere, so it will find my 8.2.
2018-12-26Remove the private generic NonZero<T> wrapper type.Simon Sapin-3/+1
Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly on relevant libcore types.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12Disable btree pretty-printers on older gdbsTom Tromey-2/+13
gdb versions before 8.1 have a bug that prevents the BTreeSet and BTreeMap pretty-printers from working. This patch disables the test on those versions, and also disables the pretty-printers there as well. Closes #56730
2018-11-25Rollup merge of #56144 - tromey:Bug-55771-btreemap, r=alexcrichtonPietro Albini-29/+41
Fix BTreeSet and BTreeMap gdb pretty-printers The BTreeSet and BTreeMap gdb pretty-printers did not take the node structure into account, and consequently only worked for shallow sets. This fixes the problem by iterating over child nodes when needed. This patch avoids the current approach of implementing some of the value manipulations in debugger-indepdendent code. This was done for convenience: a type lookup was needed for the first time, and there currently are no lldb formatters for these types. Closes #55771
2018-11-24Rollup merge of #55767 - tromey:disable-some-pretty-printers, r=alexcrichtonkennytm-18/+25
Disable some pretty-printers when gdb is rust-enabled A rust-enabled gdb already knows how to display string slices, structs, tuples, and enums (and after #54004, the pretty-printers can't handle enums at all). This patch disables these pretty-printers when gdb is rust-enabled. The "gdb-pretty-struct-and-enums-pre-gdb-7-7.rs" test is renamed, because it does not seem to depend on any behavior of that version of gdb, and because gdb 7.7 is 4 years old now.
2018-11-21Fix BTreeSet and BTreeMap gdb pretty-printersTom Tromey-29/+41
The BTreeSet and BTreeMap gdb pretty-printers did not take the node structure into account, and consequently only worked for shallow sets. This fixes the problem by iterating over child nodes when needed. This patch avoids the current approach of implementing some of the value manipulations in debugger-indepdendent code. This was done for convenience: a type lookup was needed for the first time, and there currently are no lldb formatters for these types. Closes #55771
2018-11-19Disable some pretty-printers when gdb is rust-enabledTom Tromey-18/+25
A rust-enabled gdb already knows how to display string slices, structs, tuples, and enums (and after #54004, the pretty-printers can't handle enums at all). This patch disables these pretty-printers when gdb is rust-enabled. The "gdb-pretty-struct-and-enums-pre-gdb-7-7.rs" test is renamed, because it does not seem to depend on any behavior of that version of gdb, and because gdb 7.7 is 4 years old now.
2018-11-14Fix VecDeque pretty-printerTom Tromey-3/+11
This fixes the VecDeque pretty-printer to handle cases where head < tail. Closes #55944
2018-10-28Remove unused re import in gdb_rust_pretty_printingKonrad Borowski-1/+0
2018-10-09fix tidyJorge Aparicio-3/+5
2018-10-09gdb_rust_pretty_printing: adapt to the changes in the layout of btree::LeafNodeJorge Aparicio-4/+10
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-12/+4
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-22fix tidyJorge Aparicio-3/+5
2018-09-22gdb_rust_pretty_printing: adapt to the changes in the layout of btree::LeafNodeJorge Aparicio-4/+10
2018-08-15pretty printing for btreemapUnknown-0/+30
2018-08-13fix behaviorUnknown-3/+2
2018-08-13bug fixUnknown-1/+1
2018-08-06pretty print BTreeSetfukatani-0/+27
2018-07-29fix coding styleUnknown-2/+4
2018-07-29pretty print for std::collections::vecdequeUnknown-0/+23
2017-10-06Implement display_hint in gdb pretty printersTom Tromey-4/+11
A few pretty-printers were returning a quoted string from their to_string method. It's preferable in gdb to return a lazy string and to let gdb handle the display by having a "display_hint" method that returns "string" -- it lets gdb settings (like "set print ...") work, it handles corrupted strings a bit better, and it passes the information along to IDEs.
2017-06-09Add compat_str() which works with unicode in both Python 2 and 3gentoo90-1/+1
GDB can be built with Python 2 or with Python 3
2017-06-02Add separate GDB pretty-printer for empty structsgentoo90-2/+12
Use a class without children() method for printing empty structs. Presence of this method makes GDB's variable objects interface act like if the struct had children.
2017-06-02Add GDB pretty-printer for OsStringgentoo90-0/+18
2017-05-30Fix 'invalid literal for int()' exception with unicode in pretty-printersgentoo90-1/+1
str() can't handle unicode strings
2017-05-30Fix 'invalid literal for int()' exception in pretty-printersgentoo90-1/+2
Some pointers values include additional info, so they can't be parsed with int().
2017-05-28Fix GDB pretty-printer for tuplesgentoo90-2/+2
Names of children should not be the same, because GDB uses them to distinguish the children.
2016-09-17modern style classesEitan Adler-7/+7
2016-09-17make functions static where possibleEitan Adler-2/+4
2016-08-31Auto merge of #35585 - Kha:gdb-qualified, r=michaelwoeristerbors-1/+1
gdb: Fix pretty-printing special-cased Rust types gdb trunk now reports fully qualified type names, just like lldb. Move lldb code for extracting unqualified names to shared file. For current releases of gdb, `extract_type_name` should just be a no-op. Fixes #35155
2016-08-17Make version check in gdb_rust_pretty_printing.py more compatible.Michael Woerister-1/+1
Some versions of Python don't support the `major` field on the object returned by `sys.version_info`.
2016-08-10gdb: Fix pretty-printing special-cased Rust typesSebastian Ullrich-1/+1
gdb trunk now reports fully qualified type names, just like lldb. Move lldb code for extracting unqualified names to shared file.
2016-07-06etc: Comment why we're binding xrangeAlex Crichton-0/+3
Just mention there are differences between python versions
2016-07-05Use lazy range in gdb pretty printersLoïc Damien-2/+6
2016-07-04Use lazy iterator in vec/slice gdb pretty printersLoïc Damien-7/+2
2016-05-12Generic encoded enums no longer crash on reference/pointer typesSteven Burns-0/+2
2015-05-30debuginfo: Create common debugger pretty printer module.Michael Woerister-230/+169
GDB and LLDB pretty printers have some common functionality and also access some common information, such as the layout of standard library types. So far, this information has been duplicated in the two pretty printing python modules. This commit introduces a common module used by both debuggers.
2015-04-12Add a name for tuple fields in debuginfo so that they can be accessed in ↵Michael Woerister-3/+9
debuggers.
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-1/+1
2015-03-12debuginfo: Add GDB pretty printers for slices, Vec<>, and String.Michael Woerister-1/+88
2015-01-27Fix PEP8 in gdb pretty printerRicho Healey-176/+188
2015-01-04Pylinted and slightly better commentedKelvin Ly-3/+7