• Home
  • Raw
  • Download

Lines Matching +full:fedora +full:- +full:36 +full:- +full:clang

1 # Verify that gdb can pretty-print the various PyObject* types
20 cmd = ["gdb", "-nx", "--version"]
38 # 'GNU gdb (GDB; SUSE Linux Enterprise 12) 7.7\n' -> 7.7
39 # 'GNU gdb (GDB) Fedora 7.9.1-17.fc22\n' -> 7.9
40 # 'GNU gdb 6.1.1 [FreeBSD]\n' -> 6.1
41 # 'GNU gdb (GDB) Fedora (7.5.1-37.fc18)\n' -> 7.5
42 # 'HP gdb 6.7 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.\n' -> 6.7
58 if 'Clang' in platform.python_compiler() and sys.platform == 'darwin':
60 " built with LLVM clang")
68 'python-gdb.py')
78 # True if "-mcet -fcf-protection" options are found, but false
79 # if "-fcf-protection=none" or "-fcf-protection=return" is found.
80 return (('-mcet' in flags)
81 and any((flag.startswith('-fcf-protection')
85 # Control-flow enforcement technology
90 """Runs gdb in --batch mode with the additional arguments given by *args.
92 Returns its (stdout, stderr) decoded from utf-8 using the replace handler.
99 # -nx: Do not execute commands from any .gdbinit initialization files
101 base_cmd = ('gdb', '--batch', '-nx')
103 base_cmd += ('-iex', 'add-auto-load-safe-path ' + checkout_hook_path)
113 return out.decode('utf-8', 'replace'), err.decode('utf-8', 'replace')
116 gdbpy_version, _ = run_gdb("--eval-command=python import sys; print(sys.version_info)")
125 _, gdbpy_errors = run_gdb('--args', sys.executable)
126 if "auto-loading has been declined" in gdbpy_errors:
132 stdout, _ = run_gdb("--eval-command=python print(dir(gdb.Frame))")
154 Run 'python -c SOURCE' under gdb with a breakpoint.
171 # Initially I had "--eval-command=continue" here, but removed it to
198 commands += ['set print entry-values no']
202 # bpo-32962: When Python is compiled with -mcet
203 # -fcf-protection, function arguments are unusable before
214 args = ['--eval-command=%s' % cmd for cmd in commands]
215 args += ["--args",
220 # -S suppresses the default 'import site'
221 args += ["-S"]
224 args += ["-c", source]
235 # bpo-34007: Sometimes some versions of the shared libraries that
245 # bpo-40019: Skip the test if gdb failed to read debug information
260 # run "python -c'id(DATA)'" under gdb with a breakpoint on
267 # give us the top-level structure
283 # bpo-38239: builtin_id() is defined in Python/bltinmodule.c,
286 r'\s+at\s+\S*[A-Za-z]+/[A-Za-z0-9_-]+\.c',
321 'Verify the pretty-printing of various int values'
324 self.assertGdbRepr(-7)
326 self.assertGdbRepr(-1000000000000000)
329 'Verify the pretty-printing of True, False and None'
335 'Verify the pretty-printing of dictionaries'
342 'Verify the pretty-printing of lists'
347 'Verify the pretty-printing of bytes'
352 b' this is a slash-N:\n'
353 b' this is a slash-R:\r'
361 'Verify the pretty-printing of unicode strings'
367 '--eval-command',
400 # UTF-8: 0xF0 0x9D 0x84 0xA1
401 # UTF-16: 0xD834 0xDD21
405 'Verify the pretty-printing of tuples'
411 'Verify the pretty-printing of sets'
413 self.skipTest("pretty-printing of sets needs gdb 7.3 or later")
429 'Verify the pretty-printing of frozensets'
431 self.skipTest("pretty-printing of frozensets needs gdb 7.3 or later")
462 'Verify the pretty-printing of new-style class instances'
469 m = re.match(r'<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>', gdb_repr)
471 msg='Unexpected new-style class rendering %r' % gdb_repr)
474 'Verify the pretty-printing of an instance of a list subclass'
482 m = re.match(r'<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>', gdb_repr)
485 msg='Unexpected new-style class rendering %r' % gdb_repr)
488 'Verify the pretty-printing of an instance of a tuple subclass'
490 # new-style class support
497 m = re.match(r'<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>', gdb_repr)
500 msg='Unexpected new-style class rendering %r' % gdb_repr)
524 pattern = '<.* at remote 0x-?[0-9a-f]+>'
544 'set v->ob_type=0')
549 'set v->ob_type=0xDEADBEEF',
555 'set v->ob_type->tp_flags=0x0',
561 'set v->ob_type->tp_name=0xDEADBEEF',
565 'Ensure that the new-style class _Helper in site.py can be handled'
568 self.skipTest("need site module, but -S option was used")
574 m = re.match(r'<_Helper\(\) at remote 0x-?[0-9a-f]+>', gdb_repr)
605 self.assertTrue(re.match(r'<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>',
618 self.assertTrue(re.match(r'<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>',
632 …match(r'<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>\) at remote 0x-?[0-9a-f]+>…
643 "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, "
667 …self.assertTrue(re.match(r'<built-in method readlines of _io.TextIOWrapper object at remote 0x-?[0
683 …self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 4, in foo \(a…
695 'Verify that the "py-list" command works'
697 cmds_after_breakpoint=['py-list'])
710 'Verify the "py-list" command with one absolute argument'
712 cmds_after_breakpoint=['py-list 9'])
721 'Verify the "py-list" command with two absolute arguments'
723 cmds_after_breakpoint=['py-list 1,3'])
749 @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
753 'Verify that the "py-up" command works'
755 cmds_after_breakpoint=['py-up', 'py-up'])
758 #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12, in baz \(args=\(1, 2, 3\)\)
759 #[0-9]+ <built-in method pyobject_fastcall of module object at remote 0x[0-9a-f]+>
762 @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
764 'Verify handling of "py-down" at the bottom of the stack'
766 cmds_after_breakpoint=['py-down'])
770 @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
772 'Verify handling of "py-up" at the top of the stack'
774 cmds_after_breakpoint=['py-up'] * 5)
778 @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
782 'Verify "py-up" followed by "py-down"'
784 cmds_after_breakpoint=['py-up', 'py-up', 'py-down'])
787 #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12, in baz \(args=\(1, 2, 3\)\)
788 #[0-9]+ <built-in method pyobject_fastcall of module object at remote 0x[0-9a-f]+>
789 #[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12, in baz \(args=\(1, 2, 3\)\)
796 'Verify that the "py-bt" command works'
798 cmds_after_breakpoint=['py-bt'])
802 <built-in method id of module object .*>
816 'Verify that the "py-bt-full" command works'
818 cmds_after_breakpoint=['py-bt-full'])
821 #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
823 #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\)
825 #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\)
832 'Verify that "py-bt" indicates threads that are waiting for the GIL'
853 # Verify with "py-bt":
855 cmds_after_breakpoint=['thread apply all py-bt'])
858 # Verify with "py-bt-full":
860 cmds_after_breakpoint=['thread apply all py-bt-full'])
867 # unless we add LD_PRELOAD=PATH-TO-libpthread.so.1 as a workaround
869 'Verify that "py-bt" indicates if a thread is garbage-collecting'
877 # Verify with "py-bt":
879 … cmds_after_breakpoint=['break update_refs', 'continue', 'py-bt'],
881 self.assertIn('Garbage-collecting', gdb_output)
883 # Verify with "py-bt-full":
885 … cmds_after_breakpoint=['break update_refs', 'continue', 'py-bt-full'],
887 self.assertIn('Garbage-collecting', gdb_output)
894 # unless we add LD_PRELOAD=PATH-TO-libpthread.so.1 as a workaround
899 # (_testcapimodule) rather than compiled-in functions. It seems difficult
902 'Verify that "py-bt" displays invocations of PyCFunction instances'
903 # bpo-46600: If the compiler inlines _null_to_none() in meth_varargs()
904 # (ex: clang -Og), _null_to_none() is the frame #1. Otherwise,
935 # Verify with "py-bt":
939 cmds_after_breakpoint=['bt', 'py-bt'],
940 # bpo-45207: Ignore 'Function "meth_varargs" not
944 self.assertIn(f'<built-in method {func_name}', gdb_output)
946 # Verify with "py-bt-full":
950 cmds_after_breakpoint=['py-bt-full'],
951 # bpo-45207: Ignore 'Function "meth_varargs" not
956 regex += re.escape(f' <built-in method {func_name}')
972 # bpo-32962: same case as in get_stack_trace():
976 cmds_after_breakpoint.append('py-bt')
978 # Verify with "py-bt":
982 r"<method-wrapper u?'__init__' of MyList object at ")
988 'Verify that the "py-print" command works'
990 cmds_after_breakpoint=['py-up', 'py-print args'])
996 @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
999 … cmds_after_breakpoint=['py-up', 'py-up', 'py-print c', 'py-print b', 'py-print a'])
1007 cmds_after_breakpoint=['py-up', 'py-print __name__'])
1015 cmds_after_breakpoint=['py-up', 'py-print len'])
1017 … r".*\nbuiltin 'len' = <built-in method len of module object at remote 0x-?[0-9a-f]+>\n.*")
1024 cmds_after_breakpoint=['py-up', 'py-locals'])
1028 @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
1033 cmds_after_breakpoint=['py-up', 'py-up', 'py-locals'])