This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 28/40] use explicit returns to avoid checker confusion
- From: Tom Tromey <tromey at redhat dot com>
- To: asmwarrior <asmwarrior at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 24 May 2013 09:41:52 -0600
- Subject: Re: [PATCH 28/40] use explicit returns to avoid checker confusion
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com> <27ac4476e9e4f7a238ca9f86ec955ef6d2d21c02 dot 1368124285 dot git dot tromey at redhat dot com> <519EBAE8 dot 9030909 at gmail dot com> <87sj1d9nau dot fsf at fleche dot redhat dot com>
Tom> I think the patch series needs to be rebased. This function's got
Tom> changed as part of the Python reference counting series. I'll fix it up
Tom> and re-send modified patches soon, probably next week.
I rebased today and this was the only patch requiring a fix.
Here is the new version.
Tom
* python/py-breakpoint.c (bppy_get_commands): Use
explicit, unconditional return.
* python/py-frame.c (frapy_read_var): Likewise.
* python/python.c (gdbpy_decode_line): Likewise.
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index eaa1bc5..87f1fdc 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -492,7 +492,8 @@ bppy_get_commands (PyObject *self, void *closure)
if (except.reason < 0)
{
do_cleanups (chain);
- GDB_PY_HANDLE_EXCEPTION (except);
+ gdbpy_convert_exception (except);
+ return NULL;
}
cmdstr = ui_file_xstrdup (string_file, &length);
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index 2615ddf..f960b08 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -477,7 +477,8 @@ frapy_read_var (PyObject *self, PyObject *args)
if (except.reason < 0)
{
do_cleanups (cleanup);
- GDB_PY_HANDLE_EXCEPTION (except);
+ gdbpy_convert_exception (except);
+ return NULL;
}
if (!var)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 690534f..c94198e 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -653,7 +653,8 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
{
do_cleanups (cleanups);
/* We know this will always throw. */
- GDB_PY_HANDLE_EXCEPTION (except);
+ gdbpy_convert_exception (except);
+ return NULL;
}
if (sals.nelts)