Skip to content

First attempt to fix nightlies #34689

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

Merged
merged 3 commits into from
Jul 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

import gdb
import re
import sys
import debugger_pretty_printers_common as rustpp

# We want a version of `range` which doesn't allocate an intermediate list,
# specifically it should use a lazy iterator. In Python 2 this was `xrange`, but
# if we're running with Python 3 then we need to use `range` instead.
if sys.version_info.major >= 3:
xrange = range

#===============================================================================
# GDB Pretty Printing Module for Rust
#===============================================================================
Expand Down Expand Up @@ -215,7 +222,7 @@ def children(self):
assert data_ptr.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_PTR
raw_ptr = data_ptr.get_wrapped_value()

for index in range(0, length):
for index in xrange(0, length):
yield (str(index), (raw_ptr + index).dereference())


Expand Down Expand Up @@ -244,7 +251,7 @@ def to_string(self):
def children(self):
(length, data_ptr, cap) = rustpp.extract_length_ptr_and_cap_from_std_vec(self.__val)
gdb_ptr = data_ptr.get_wrapped_value()
for index in range(0, length):
for index in xrange(0, length):
yield (str(index), (gdb_ptr + index).dereference())


Expand Down