diff options
| author | Austin Clements <austin@google.com> | 2015-02-16 22:04:24 -0500 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2015-02-17 18:41:10 +0000 |
| commit | 98651d6edf32e4cfcff407b4441d0b537d0ad745 (patch) | |
| tree | aa21eb1603572305cece511916eca122acf9921f /src | |
| parent | 545686857bc4c2e7a5306d97e5ef48f631d277bc (diff) | |
| download | go-98651d6edf32e4cfcff407b4441d0b537d0ad745.tar.xz | |
runtime: in runtime-gdb.py, use SliceValue wrapper
Rather than reaching in to slices directly in the slice pretty
printer, use the newly introduced SliceValue wrapper.
Change-Id: Ibb25f8c618c2ffb3fe1a8dd044bb9a6a085df5b7
Reviewed-on: https://go-review.googlesource.com/4936
Reviewed-by: Minux Ma <minux@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/runtime-gdb.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/runtime-gdb.py b/src/runtime/runtime-gdb.py index 33fcc76931..6076bcb11b 100644 --- a/src/runtime/runtime-gdb.py +++ b/src/runtime/runtime-gdb.py @@ -88,11 +88,11 @@ class SliceTypePrinter: return str(self.val.type)[6:] # skip 'struct ' def children(self): - if self.val["len"] > self.val["cap"]: + sval = SliceValue(self.val) + if sval.len > sval.cap: return - ptr = self.val["array"] - for idx in range(int(self.val["len"])): - yield ('[{0}]'.format(idx), (ptr + idx).dereference()) + for idx, item in enumerate(sval): + yield ('[{0}]'.format(idx), item) class MapTypePrinter: |
