Lines Matching refs:gdb
1 # Verify that gdb can pretty-print the various PyObject* types
3 # The code for testing gdb was adapted from similar work in Unladen Swallow's
16 gdb_version, _ = subprocess.Popen(["gdb", "--version"],
19 # This is what "no gdb" looks like. There may, however, be other
21 raise unittest.SkipTest("Couldn't find gdb on the path")
22 gdb_version_number = re.search("^GNU gdb [^\d]*(\d+)\.(\d)", gdb_version)
26 raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding"
31 'python-gdb.py')
34 """Runs gdb in --batch mode with the additional arguments given by *args.
43 base_cmd = ('gdb', '--batch')
51 # Verify that "gdb" was built with the embedded python support enabled:
54 raise unittest.SkipTest("gdb not built with embedded python support")
56 # Verify that "gdb" can load our custom hooks. In theory this should never
62 msg = "gdb security settings prevent use of custom hooks: "
73 # Does this build of gdb have gdb.Frame.select ?
74 stdout, _ = run_gdb("--eval-command=python print(dir(gdb.Frame))")
77 raise unittest.SkipTest("Unable to parse output from gdb.Frame.select test")
92 Run 'python -c SOURCE' under gdb with a breakpoint.
96 Returns the stdout from gdb
98 cmds_after_breakpoint: if provided, a list of strings: gdb commands
113 # Generate a list of commands in gdb's language:
124 # Use "commands" to generate the arguments with which to invoke "gdb":
125 args = ["gdb", "--batch"]
142 # Use "args" to invoke gdb, capturing stdout, stderr:
177 # run "python -c'print DATA'" under gdb with a breakpoint on
178 # PyObject_Print and scrape out gdb's representation of the "op"
179 # parameter, and verify that the gdb displays the same string
186 # gdb can insert additional '\n' and space characters in various places
192 self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
213 # Ensure that gdb's rendering of the value in a debugged process
393 '''Run Python under gdb, corrupting variables in the inferior process
409 # gdb managed to print the value in spite of the corruption;
422 self.fail('Unexpected gdb representation: %r\n%s' % \
510 'Unexpected gdb representation: %r\n%s' % \
523 'Unexpected gdb representation: %r\n%s' % \
537 'Unexpected gdb representation: %r\n%s' % \
576 'Unexpected gdb representation: %r\n%s' % \
592 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output))