aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:30:03 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:30:03 +0000
commitf3300387104722cbfcfc955bdacb474c7f33ba9e (patch)
tree3f393ef58f81481da206005d7471b2a46cf1b44d /gdb/python/py-breakpoint.c
parentc27e16e3f1dcf904e09c4d725bc6dbde7e9ef172 (diff)
downloadgdb-f3300387104722cbfcfc955bdacb474c7f33ba9e.zip
gdb-f3300387104722cbfcfc955bdacb474c7f33ba9e.tar.gz
gdb-f3300387104722cbfcfc955bdacb474c7f33ba9e.tar.bz2
use explicit returns to avoid checker confusion
The checker does not understand the idiom if (except.reason < 0) { do_cleanups (whatever); GDB_PY_HANDLE_EXCEPTION (except); } because it doesn't realize that the nested 'if' actually has the same condition. This fixes instances of this to be more explicit. * 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.
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c3
1 files changed, 2 insertions, 1 deletions
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);