Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: Tools/gdb/libpython.py

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Patch Set: Created 3 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Objects/weakrefobject.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 ''' 2 '''
3 From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb 3 From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
4 to be extended with Python code e.g. for library-specific data visualizations, 4 to be extended with Python code e.g. for library-specific data visualizations,
5 such as for the C++ STL types. Documentation on this API can be seen at: 5 such as for the C++ STL types. Documentation on this API can be seen at:
6 http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html 6 http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html
7 7
8 8
9 This python module deals with the case when the process being debugged (the 9 This python module deals with the case when the process being debugged (the
10 "inferior process" in gdb parlance) is itself python, or more specifically, 10 "inferior process" in gdb parlance) is itself python, or more specifically,
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 return 'Garbage-collecting' 1497 return 'Garbage-collecting'
1498 1498
1499 # Detect invocations of PyCFunction instances: 1499 # Detect invocations of PyCFunction instances:
1500 frame = self._gdbframe 1500 frame = self._gdbframe
1501 caller = frame.name() 1501 caller = frame.name()
1502 if not caller: 1502 if not caller:
1503 return False 1503 return False
1504 1504
1505 if caller in ('_PyCFunction_FastCallDict', 1505 if caller in ('_PyCFunction_FastCallDict',
1506 '_PyCFunction_FastCallKeywords'): 1506 '_PyCFunction_FastCallKeywords'):
1507 if caller == '_PyCFunction_FastCallKeywords': 1507 if caller == '_PyCFunction_FastCallDict':
1508 arg_name = 'func_obj' 1508 arg_name = 'func_obj'
1509 else: 1509 else:
1510 arg_name = 'func' 1510 arg_name = 'func'
1511 # Within that frame: 1511 # Within that frame:
1512 # "func" is the local containing the PyObject* of the 1512 # "func" is the local containing the PyObject* of the
1513 # PyCFunctionObject instance 1513 # PyCFunctionObject instance
1514 # "f" is the same value, but cast to (PyCFunctionObject*) 1514 # "f" is the same value, but cast to (PyCFunctionObject*)
1515 # "self" is the (PyObject*) of the 'self' 1515 # "self" is the (PyObject*) of the 'self'
1516 try: 1516 try:
1517 # Use the prettyprinter for the func: 1517 # Use the prettyprinter for the func:
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 if not pyop_frame: 1865 if not pyop_frame:
1866 print('Unable to read information on python frame') 1866 print('Unable to read information on python frame')
1867 return 1867 return
1868 1868
1869 for pyop_name, pyop_value in pyop_frame.iter_locals(): 1869 for pyop_name, pyop_value in pyop_frame.iter_locals():
1870 print('%s = %s' 1870 print('%s = %s'
1871 % (pyop_name.proxyval(set()), 1871 % (pyop_name.proxyval(set()),
1872 pyop_value.get_truncated_repr(MAX_OUTPUT_LEN))) 1872 pyop_value.get_truncated_repr(MAX_OUTPUT_LEN)))
1873 1873
1874 PyLocals() 1874 PyLocals()
OLDNEW
« no previous file with comments | « Objects/weakrefobject.c ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+