This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/8] Python: Move and rename gdb.BtraceInstruction
Tim Wiederhake <tim.wiederhake@intel.com> writes:
Hi Tim,
> -static PyObject *
> -btpy_insn_sal (PyObject *self, void *closure)
> +PyObject *
> +recpy_bt_insn_sal (PyObject *self, void *closure)
> {
> - const btpy_object * const obj = (btpy_object *) self;
> - const struct btrace_insn *insn;
> - struct btrace_insn_iterator iter;
> + const btrace_insn * const insn = btrace_insn_from_recpy_insn (self);
> PyObject *result = NULL;
>
> - BTPY_REQUIRE_VALID_INSN (obj, iter);
> -
> - insn = btrace_insn_get (&iter);
> if (insn == NULL)
> - Py_RETURN_NONE;
> + return NULL;
IIUC, "return NULL" tells python to raise exception, but why do we
change the function's behavior (Py_RETURN_NONE -> "return NULL")? The
change is out of the scope of "Move and rename gdb.BtraceInstruction".
--
Yao (齐尧)