[Lldb-commits] [PATCH] D68995: clean up the implementation of PythonCallable::GetNumArguments

Lawrence D'Anna via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 15 08:56:39 PDT 2019


lawrence_danna created this revision.
lawrence_danna added reviewers: JDevlieghere, clayborg, labath, jingham.
Herald added a project: LLDB.

The current implementation of PythonCallable::GetNumArguments 
is not exception safe, has weird semantics, and is just plain 
incorrect for some kinds of functions.

Python 3.3 introduces inspect.signature, which lets us easily 
query for function signatures in a sane and documented way.

This patch leaves the old implementation in place for < 3.3, 
but uses inspect.signature for modern pythons.   It also leaves
the old weird semantics in place, but with FIXMEs grousing about 
it.   We should update the callers and fix the semantics in a
subsequent patch.    It also adds some tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68995

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68995.225053.patch
Type: text/x-patch
Size: 14769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191015/bc320f09/attachment-0001.bin>


More information about the lldb-commits mailing list