diff options
| author | EFanZh <efanzh@gmail.com> | 2021-07-03 23:42:07 +0800 | 
|---|---|---|
| committer | EFanZh <efanzh@gmail.com> | 2021-07-03 23:42:07 +0800 | 
| commit | 0112b908f78960dc3485ca3de01a62861fc7311f (patch) | |
| tree | ad497fab372966c97d9d5638a9935c7ff4976573 /src/etc/gdb_lookup.py | |
| parent | a8b8558f083d86247ef3260ebb4f97b276cdbf73 (diff) | |
| download | rust-0112b908f78960dc3485ca3de01a62861fc7311f.tar.gz rust-0112b908f78960dc3485ca3de01a62861fc7311f.zip | |
Support pretty printing slices using GDB
Diffstat (limited to 'src/etc/gdb_lookup.py')
| -rw-r--r-- | src/etc/gdb_lookup.py | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/src/etc/gdb_lookup.py b/src/etc/gdb_lookup.py index a5a1824c84e..292e91b4d5d 100644 --- a/src/etc/gdb_lookup.py +++ b/src/etc/gdb_lookup.py @@ -5,7 +5,6 @@ from gdb_providers import * from rust_types import * -rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to_string=True) _gdb_version_matched = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION) gdb_version = [int(num) for num in _gdb_version_matched.groups()] if _gdb_version_matched else [] @@ -52,9 +51,10 @@ def lookup(valobj): return StdStringProvider(valobj) if rust_type == RustType.STD_OS_STRING: return StdOsStringProvider(valobj) - if rust_type == RustType.STD_STR and not rust_enabled: + if rust_type == RustType.STD_STR: return StdStrProvider(valobj) - + if rust_type == RustType.STD_SLICE: + return StdSliceProvider(valobj) if rust_type == RustType.STD_VEC: return StdVecProvider(valobj) if rust_type == RustType.STD_VEC_DEQUE: | 
