Back to index

python3.2  3.2.2
Public Member Functions
test.test_gdb.PrettyPrintTests Class Reference
Inheritance diagram for test.test_gdb.PrettyPrintTests:
Inheritance graph
[legend]
Collaboration diagram for test.test_gdb.PrettyPrintTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_getting_backtrace
def assertGdbRepr
def test_int
def test_singletons
def test_dicts
def test_lists
def test_bytes
def test_strings
def test_tuples
def test_sets
def test_frozensets
def test_exceptions
def test_modern_class
def test_subclassing_list
def test_subclassing_tuple
def assertSane
def test_NULL_ptr
def test_NULL_ob_type
def test_corrupt_ob_type
def test_corrupt_tp_flags
def test_corrupt_tp_name
def test_builtins_help
def test_selfreferential_list
def test_selfreferential_dict
def test_selfreferential_old_style_instance
def test_selfreferential_new_style_instance
def test_truncation
def test_builtin_method
def test_frames
def run_gdb
def get_stack_trace
def get_gdb_repr
def assertEndsWith
def assertMultilineMatches
def get_sample_script

Detailed Description

Definition at line 176 of file test_gdb.py.


Member Function Documentation

def test.test_gdb.DebuggerTests.assertEndsWith (   self,
  actual,
  exp_end 
) [inherited]
Ensure that the given "actual" string ends with "exp_end"

Definition at line 163 of file test_gdb.py.

00163 
00164     def assertEndsWith(self, actual, exp_end):
00165         '''Ensure that the given "actual" string ends with "exp_end"'''
00166         self.assertTrue(actual.endswith(exp_end),
00167                         msg='%r did not end with %r' % (actual, exp_end))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_gdb.PrettyPrintTests.assertGdbRepr (   self,
  val,
  exp_repr = None,
  cmds_after_breakpoint = None 
)

Definition at line 181 of file test_gdb.py.

00181 
00182     def assertGdbRepr(self, val, exp_repr=None, cmds_after_breakpoint=None):
00183         # Ensure that gdb's rendering of the value in a debugged process
00184         # matches repr(value) in this process:
00185         gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')',
00186                                                  cmds_after_breakpoint)
00187         if not exp_repr:
00188             exp_repr = repr(val)
00189         self.assertEqual(gdb_repr, exp_repr,
00190                          ('%r did not equal expected %r; full output was:\n%s'
00191                           % (gdb_repr, exp_repr, gdb_output)))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_gdb.DebuggerTests.assertMultilineMatches (   self,
  actual,
  pattern 
) [inherited]

Definition at line 168 of file test_gdb.py.

00168 
00169     def assertMultilineMatches(self, actual, pattern):
00170         m = re.match(pattern, actual, re.DOTALL)
00171         if not m:
00172             self.fail(msg='%r did not match %r' % (actual, pattern))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_gdb.PrettyPrintTests.assertSane (   self,
  source,
  corruption,
  exprepr = None 
)
Run Python under gdb, corrupting variables in the inferior process
immediately before taking a backtrace.

Verify that the variable's representation is the expected failsafe
representation

Definition at line 351 of file test_gdb.py.

00351 
00352     def assertSane(self, source, corruption, exprepr=None):
00353         '''Run Python under gdb, corrupting variables in the inferior process
00354         immediately before taking a backtrace.
00355 
00356         Verify that the variable's representation is the expected failsafe
00357         representation'''
00358         if corruption:
00359             cmds_after_breakpoint=[corruption, 'backtrace']
00360         else:
00361             cmds_after_breakpoint=['backtrace']
00362 
00363         gdb_repr, gdb_output = \
00364             self.get_gdb_repr(source,
00365                               cmds_after_breakpoint=cmds_after_breakpoint)
00366         if exprepr:
00367             if gdb_repr == exprepr:
00368                 # gdb managed to print the value in spite of the corruption;
00369                 # this is good (see http://bugs.python.org/issue8330)
00370                 return
00371 
00372         # Match anything for the type name; 0xDEADBEEF could point to
00373         # something arbitrary (see  http://bugs.python.org/issue8330)
00374         pattern = '<.* at remote 0x[0-9a-f]+>'
00375 
00376         m = re.match(pattern, gdb_repr)
00377         if not m:
00378             self.fail('Unexpected gdb representation: %r\n%s' % \
00379                           (gdb_repr, gdb_output))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_gdb.DebuggerTests.get_gdb_repr (   self,
  source,
  cmds_after_breakpoint = None,
  import_site = False 
) [inherited]

Definition at line 141 of file test_gdb.py.

00141 
00142                      import_site=False):
00143         # Given an input python source representation of data,
00144         # run "python -c'id(DATA)'" under gdb with a breakpoint on
00145         # builtin_id and scrape out gdb's representation of the "op"
00146         # parameter, and verify that the gdb displays the same string
00147         #
00148         # Verify that the gdb displays the expected string
00149         #
00150         # For a nested structure, the first time we hit the breakpoint will
00151         # give us the top-level structure
00152         gdb_output = self.get_stack_trace(source, breakpoint=BREAKPOINT_FN,
00153                                           cmds_after_breakpoint=cmds_after_breakpoint,
00154                                           import_site=import_site)
00155         # gdb can insert additional '\n' and space characters in various places
00156         # in its output, depending on the width of the terminal it's connected
00157         # to (using its "wrap_here" function)
00158         m = re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+Python/bltinmodule.c.*',
00159                      gdb_output, re.DOTALL)
00160         if not m:
00161             self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
00162         return m.group(1), gdb_output

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 173 of file test_gdb.py.

00173 
00174     def get_sample_script(self):
00175         return findfile('gdb_sample.py')

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_gdb.DebuggerTests.get_stack_trace (   self,
  source = None,
  script = None,
  breakpoint = BREAKPOINT_FN,
  cmds_after_breakpoint = None,
  import_site = False 
) [inherited]
Run 'python -c SOURCE' under gdb with a breakpoint.

Support injecting commands after the breakpoint is reached

Returns the stdout from gdb

cmds_after_breakpoint: if provided, a list of strings: gdb commands

Definition at line 68 of file test_gdb.py.

00068 
00069                         import_site=False):
00070         '''
00071         Run 'python -c SOURCE' under gdb with a breakpoint.
00072 
00073         Support injecting commands after the breakpoint is reached
00074 
00075         Returns the stdout from gdb
00076 
00077         cmds_after_breakpoint: if provided, a list of strings: gdb commands
00078         '''
00079         # We use "set breakpoint pending yes" to avoid blocking with a:
00080         #   Function "foo" not defined.
00081         #   Make breakpoint pending on future shared library load? (y or [n])
00082         # error, which typically happens python is dynamically linked (the
00083         # breakpoints of interest are to be found in the shared library)
00084         # When this happens, we still get:
00085         #   Function "textiowrapper_write" not defined.
00086         # emitted to stderr each time, alas.
00087 
00088         # Initially I had "--eval-command=continue" here, but removed it to
00089         # avoid repeated print breakpoints when traversing hierarchical data
00090         # structures
00091 
00092         # Generate a list of commands in gdb's language:
00093         commands = ['set breakpoint pending yes',
00094                     'break %s' % breakpoint,
00095                     'run']
00096         if cmds_after_breakpoint:
00097             commands += cmds_after_breakpoint
00098         else:
00099             commands += ['backtrace']
00100 
00101         # print commands
00102 
00103         # Use "commands" to generate the arguments with which to invoke "gdb":
00104         args = ["gdb", "--batch"]
00105         args += ['--eval-command=%s' % cmd for cmd in commands]
00106         args += ["--args",
00107                  sys.executable]
00108 
00109         if not import_site:
00110             # -S suppresses the default 'import site'
00111             args += ["-S"]
00112 
00113         if source:
00114             args += ["-c", source]
00115         elif script:
00116             args += [script]
00117 
00118         # print args
00119         # print ' '.join(args)
00120 
00121         # Use "args" to invoke gdb, capturing stdout, stderr:
00122         out, err = self.run_gdb(*args)
00123 
00124         # Ignore some noise on stderr due to the pending breakpoint:
00125         err = err.replace('Function "%s" not defined.\n' % breakpoint, '')
00126         # Ignore some other noise on stderr (http://bugs.python.org/issue8600)
00127         err = err.replace("warning: Unable to find libthread_db matching"
00128                           " inferior's thread library, thread debugging will"
00129                           " not be available.\n",
00130                           '')
00131         err = err.replace("warning: Cannot initialize thread debugging"
00132                           " library: Debugger service failed\n",
00133                           '')
00134 
00135         # Ensure no unexpected error messages:
00136         self.assertEqual(err, '')
00137 
00138         return out

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_gdb.DebuggerTests.run_gdb (   self,
  args 
) [inherited]
Runs gdb with the command line given by *args.

Returns its stdout, stderr

Definition at line 55 of file test_gdb.py.

00055 
00056     def run_gdb(self, *args):
00057         """Runs gdb with the command line given by *args.
00058 
00059         Returns its stdout, stderr
00060         """
00061         out, err = subprocess.Popen(
00062             args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
00063             ).communicate()
00064         return out.decode('utf-8', 'replace'), err.decode('utf-8', 'replace')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 510 of file test_gdb.py.

00510 
00511     def test_builtin_method(self):
00512         gdb_repr, gdb_output = self.get_gdb_repr('import sys; id(sys.stdout.readlines)')
00513         self.assertTrue(re.match('<built-in method readlines of _io.TextIOWrapper object at remote 0x[0-9a-f]+>',
00514                                  gdb_repr),
00515                         'Unexpected gdb representation: %r\n%s' % \
00516                             (gdb_repr, gdb_output))

Here is the call graph for this function:

Definition at line 413 of file test_gdb.py.

00413 
00414     def test_builtins_help(self):
00415         'Ensure that the new-style class _Helper in site.py can be handled'
00416         # (this was the issue causing tracebacks in
00417         #  http://bugs.python.org/issue8032#msg100537 )
00418         gdb_repr, gdb_output = self.get_gdb_repr('id(__builtins__.help)', import_site=True)
00419 
00420         m = re.match(r'<_Helper at remote 0x[0-9a-f]+>', gdb_repr)
00421         self.assertTrue(m,
00422                         msg='Unexpected rendering %r' % gdb_repr)

Here is the call graph for this function:

Definition at line 217 of file test_gdb.py.

00217 
00218     def test_bytes(self):
00219         'Verify the pretty-printing of bytes'
00220         self.assertGdbRepr(b'')
00221         self.assertGdbRepr(b'And now for something hopefully the same')
00222         self.assertGdbRepr(b'string with embedded NUL here \0 and then some more text')
00223         self.assertGdbRepr(b'this is a tab:\t'
00224                            b' this is a slash-N:\n'
00225                            b' this is a slash-R:\r'
00226                            )
00227 
00228         self.assertGdbRepr(b'this is byte 255:\xff and byte 128:\x80')
00229 
00230         self.assertGdbRepr(bytes([b for b in range(255)]))

Here is the call graph for this function:

Definition at line 395 of file test_gdb.py.

00395 
00396     def test_corrupt_ob_type(self):
00397         'Ensure that a PyObject* with a corrupt ob_type is handled gracefully'
00398         self.assertSane('id(42)',
00399                         'set v->ob_type=0xDEADBEEF',
00400                         exprepr='42')

Here is the call graph for this function:

Definition at line 401 of file test_gdb.py.

00401 
00402     def test_corrupt_tp_flags(self):
00403         'Ensure that a PyObject* with a type with corrupt tp_flags is handled'
00404         self.assertSane('id(42)',
00405                         'set v->ob_type->tp_flags=0x0',
00406                         exprepr='42')

Here is the call graph for this function:

Definition at line 407 of file test_gdb.py.

00407 
00408     def test_corrupt_tp_name(self):
00409         'Ensure that a PyObject* with a type with corrupt tp_name is handled'
00410         self.assertSane('id(42)',
00411                         'set v->ob_type->tp_name=0xDEADBEEF',
00412                         exprepr='42')

Here is the call graph for this function:

Definition at line 206 of file test_gdb.py.

00206 
00207     def test_dicts(self):
00208         'Verify the pretty-printing of dictionaries'
00209         self.assertGdbRepr({})
00210         self.assertGdbRepr({'foo': 'bar'})
00211         self.assertGdbRepr({'foo': 'bar', 'douglas':42})

Here is the call graph for this function:

Definition at line 288 of file test_gdb.py.

00288 
00289     def test_exceptions(self):
00290         # Test a RuntimeError
00291         gdb_repr, gdb_output = self.get_gdb_repr('''
00292 try:
00293     raise RuntimeError("I am an error")
00294 except RuntimeError as e:
00295     id(e)
00296 ''')
00297         self.assertEqual(gdb_repr,
00298                          "RuntimeError('I am an error',)")
00299 
00300 
00301         # Test division by zero:
00302         gdb_repr, gdb_output = self.get_gdb_repr('''
00303 try:
00304     a = 1 / 0
00305 except ZeroDivisionError as e:
00306     id(e)
00307 ''')
00308         self.assertEqual(gdb_repr,
00309                          "ZeroDivisionError('division by zero',)")

Here is the call graph for this function:

Definition at line 517 of file test_gdb.py.

00517 
00518     def test_frames(self):
00519         gdb_output = self.get_stack_trace('''
00520 def foo(a, b, c):
00521     pass
00522 
00523 foo(3, 4, 5)
00524 id(foo.__code__)''',
00525                                           breakpoint='builtin_id',
00526                                           cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe)']
00527                                           )
00528         self.assertTrue(re.match('.*\s+\$1 =\s+Frame 0x[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*',
00529                                  gdb_output,
00530                                  re.DOTALL),
00531                         'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output))

Here is the call graph for this function:

Definition at line 282 of file test_gdb.py.

00282 
00283     def test_frozensets(self):
00284         'Verify the pretty-printing of frozensets'
00285         self.assertGdbRepr(frozenset())
00286         self.assertGdbRepr(frozenset(['a', 'b']))
00287         self.assertGdbRepr(frozenset([4, 5, 6]))

Here is the call graph for this function:

Definition at line 177 of file test_gdb.py.

00177 
00178     def test_getting_backtrace(self):
00179         gdb_output = self.get_stack_trace('id(42)')
00180         self.assertTrue(BREAKPOINT_FN in gdb_output)

Here is the call graph for this function:

Definition at line 192 of file test_gdb.py.

00192 
00193     def test_int(self):
00194         'Verify the pretty-printing of various "int"/long values'
00195         self.assertGdbRepr(42)
00196         self.assertGdbRepr(0)
00197         self.assertGdbRepr(-7)
00198         self.assertGdbRepr(1000000000000)
00199         self.assertGdbRepr(-1000000000000000)

Here is the call graph for this function:

Definition at line 212 of file test_gdb.py.

00212 
00213     def test_lists(self):
00214         'Verify the pretty-printing of lists'
00215         self.assertGdbRepr([])
00216         self.assertGdbRepr(list(range(5)))

Here is the call graph for this function:

Definition at line 310 of file test_gdb.py.

00310 
00311     def test_modern_class(self):
00312         'Verify the pretty-printing of new-style class instances'
00313         gdb_repr, gdb_output = self.get_gdb_repr('''
00314 class Foo:
00315     pass
00316 foo = Foo()
00317 foo.an_int = 42
00318 id(foo)''')
00319         m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
00320         self.assertTrue(m,
00321                         msg='Unexpected new-style class rendering %r' % gdb_repr)

Here is the call graph for this function:

Definition at line 390 of file test_gdb.py.

00390 
00391     def test_NULL_ob_type(self):
00392         'Ensure that a PyObject* with NULL ob_type is handled gracefully'
00393         self.assertSane('id(42)',
00394                         'set v->ob_type=0')

Here is the call graph for this function:

Definition at line 380 of file test_gdb.py.

00380 
00381     def test_NULL_ptr(self):
00382         'Ensure that a NULL PyObject* is handled gracefully'
00383         gdb_repr, gdb_output = (
00384             self.get_gdb_repr('id(42)',
00385                               cmds_after_breakpoint=['set variable v=0',
00386                                                      'backtrace'])
00387             )
00388 
00389         self.assertEqual(gdb_repr, '0x0')

Here is the call graph for this function:

Ensure that a reference loop involving a dict doesn't lead proxyval
into an infinite loop:

Definition at line 434 of file test_gdb.py.

00434 
00435     def test_selfreferential_dict(self):
00436         '''Ensure that a reference loop involving a dict doesn't lead proxyval
00437         into an infinite loop:'''
00438         gdb_repr, gdb_output = \
00439             self.get_gdb_repr("a = {} ; b = {'bar':a} ; a['foo'] = b ; id(a)")
00440 
00441         self.assertEqual(gdb_repr, "{'foo': {'bar': {...}}}")

Here is the call graph for this function:

Ensure that a reference loop involving a list doesn't lead proxyval
into an infinite loop:

Definition at line 423 of file test_gdb.py.

00423 
00424     def test_selfreferential_list(self):
00425         '''Ensure that a reference loop involving a list doesn't lead proxyval
00426         into an infinite loop:'''
00427         gdb_repr, gdb_output = \
00428             self.get_gdb_repr("a = [3, 4, 5] ; a.append(a) ; id(a)")
00429         self.assertEqual(gdb_repr, '[3, 4, 5, [...]]')
00430 
00431         gdb_repr, gdb_output = \
00432             self.get_gdb_repr("a = [3, 4, 5] ; b = [a] ; a.append(b) ; id(a)")
00433         self.assertEqual(gdb_repr, '[3, 4, 5, [[...]]]')

Here is the call graph for this function:

Definition at line 455 of file test_gdb.py.

00455 
00456     def test_selfreferential_new_style_instance(self):
00457         gdb_repr, gdb_output = \
00458             self.get_gdb_repr('''
00459 class Foo(object):
00460     pass
00461 foo = Foo()
00462 foo.an_attr = foo
00463 id(foo)''')
00464         self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>',
00465                                  gdb_repr),
00466                         'Unexpected gdb representation: %r\n%s' % \
00467                             (gdb_repr, gdb_output))
00468 
00469         gdb_repr, gdb_output = \
00470             self.get_gdb_repr('''
00471 class Foo(object):
00472     pass
00473 a = Foo()
00474 b = Foo()
00475 a.an_attr = b
00476 b.an_attr = a
00477 id(a)''')
00478         self.assertTrue(re.match('<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>\) at remote 0x[0-9a-f]+>',
00479                                  gdb_repr),
00480                         'Unexpected gdb representation: %r\n%s' % \
00481                             (gdb_repr, gdb_output))

Here is the call graph for this function:

Definition at line 442 of file test_gdb.py.

00442 
00443     def test_selfreferential_old_style_instance(self):
00444         gdb_repr, gdb_output = \
00445             self.get_gdb_repr('''
00446 class Foo:
00447     pass
00448 foo = Foo()
00449 foo.an_attr = foo
00450 id(foo)''')
00451         self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>',
00452                                  gdb_repr),
00453                         'Unexpected gdb representation: %r\n%s' % \
00454                             (gdb_repr, gdb_output))

Here is the call graph for this function:

Definition at line 269 of file test_gdb.py.

00269 
00270     def test_sets(self):
00271         'Verify the pretty-printing of sets'
00272         self.assertGdbRepr(set())
00273         self.assertGdbRepr(set(['a', 'b']))
00274         self.assertGdbRepr(set([4, 5, 6]))
00275 
00276         # Ensure that we handle sets containing the "dummy" key value,
00277         # which happens on deletion:
00278         gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b'])
00279 s.pop()
00280 id(s)''')
00281         self.assertEqual(gdb_repr, "{'b'}")

Here is the call graph for this function:

Definition at line 200 of file test_gdb.py.

00200 
00201     def test_singletons(self):
00202         'Verify the pretty-printing of True, False and None'
00203         self.assertGdbRepr(True)
00204         self.assertGdbRepr(False)
00205         self.assertGdbRepr(None)

Here is the call graph for this function:

Definition at line 231 of file test_gdb.py.

00231 
00232     def test_strings(self):
00233         'Verify the pretty-printing of unicode strings'
00234         encoding = locale.getpreferredencoding()
00235         def check_repr(text):
00236             try:
00237                 text.encode(encoding)
00238                 printable = True
00239             except UnicodeEncodeError:
00240                 self.assertGdbRepr(text, ascii(text))
00241             else:
00242                 self.assertGdbRepr(text)
00243 
00244         self.assertGdbRepr('')
00245         self.assertGdbRepr('And now for something hopefully the same')
00246         self.assertGdbRepr('string with embedded NUL here \0 and then some more text')
00247 
00248         # Test printing a single character:
00249         #    U+2620 SKULL AND CROSSBONES
00250         check_repr('\u2620')
00251 
00252         # Test printing a Japanese unicode string
00253         # (I believe this reads "mojibake", using 3 characters from the CJK
00254         # Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE)
00255         check_repr('\u6587\u5b57\u5316\u3051')
00256 
00257         # Test a character outside the BMP:
00258         #    U+1D121 MUSICAL SYMBOL C CLEF
00259         # This is:
00260         # UTF-8: 0xF0 0x9D 0x84 0xA1
00261         # UTF-16: 0xD834 0xDD21
00262         check_repr(chr(0x1D121))

Here is the call graph for this function:

Definition at line 322 of file test_gdb.py.

00322 
00323     def test_subclassing_list(self):
00324         'Verify the pretty-printing of an instance of a list subclass'
00325         gdb_repr, gdb_output = self.get_gdb_repr('''
00326 class Foo(list):
00327     pass
00328 foo = Foo()
00329 foo += [1, 2, 3]
00330 foo.an_int = 42
00331 id(foo)''')
00332         m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
00333 
00334         self.assertTrue(m,
00335                         msg='Unexpected new-style class rendering %r' % gdb_repr)

Here is the call graph for this function:

Definition at line 336 of file test_gdb.py.

00336 
00337     def test_subclassing_tuple(self):
00338         'Verify the pretty-printing of an instance of a tuple subclass'
00339         # This should exercise the negative tp_dictoffset code in the
00340         # new-style class support
00341         gdb_repr, gdb_output = self.get_gdb_repr('''
00342 class Foo(tuple):
00343     pass
00344 foo = Foo((1, 2, 3))
00345 foo.an_int = 42
00346 id(foo)''')
00347         m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
00348 
00349         self.assertTrue(m,
00350                         msg='Unexpected new-style class rendering %r' % gdb_repr)

Here is the call graph for this function:

Definition at line 482 of file test_gdb.py.

00482 
00483     def test_truncation(self):
00484         'Verify that very long output is truncated'
00485         gdb_repr, gdb_output = self.get_gdb_repr('id(list(range(1000)))')
00486         self.assertEqual(gdb_repr,
00487                          "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "
00488                          "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, "
00489                          "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, "
00490                          "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, "
00491                          "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, "
00492                          "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, "
00493                          "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, "
00494                          "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, "
00495                          "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, "
00496                          "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, "
00497                          "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, "
00498                          "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, "
00499                          "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, "
00500                          "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, "
00501                          "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, "
00502                          "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, "
00503                          "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, "
00504                          "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, "
00505                          "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, "
00506                          "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, "
00507                          "224, 225, 226...(truncated)")
00508         self.assertEqual(len(gdb_repr),
00509                          1024 + len('...(truncated)'))

Here is the call graph for this function:

Definition at line 263 of file test_gdb.py.

00263 
00264     def test_tuples(self):
00265         'Verify the pretty-printing of tuples'
00266         self.assertGdbRepr(tuple())
00267         self.assertGdbRepr((1,), '(1,)')
00268         self.assertGdbRepr(('foo', 'bar', 'baz'))

Here is the call graph for this function:


The documentation for this class was generated from the following file: