This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][python] Fix some unguarded GDB calls.
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 20 Mar 2013 09:25:11 -0600
- Subject: Re: [patch][python] Fix some unguarded GDB calls.
- References: <5149BAA9 dot 8020902 at redhat dot com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> 2013-03-20 Phil Muldoon <pmuldoon@redhat.com>
Phil> * python/py-utils.c (get_addr_from_python): Use exception handler
Phil> for value_as_address.
Phil> * python/py-cmd.c (gdbpy_parse_command_name): Use exception
Phil> handler for lookup_cmd_1..
Phil> * python/python.c (execute_gdb_command): Move bpstat_do_actions
Phil> into exception handler.
Phil> + if (except.reason < 0)
Phil> + {
Phil> + gdbpy_convert_exception (except);
Phil> + return NULL;
Phil> + }
Use GDB_PY_HANDLE_EXCEPTION instead.
Phil> get_addr_from_python (PyObject *obj, CORE_ADDR *addr)
This is documented as being able to throw gdb exceptions.
It is fine by me if you want to fix that (it certainly looks simpler
than fixing the one caller in infpy_search_memory), but then the intro
comment for the function needs an update.
Tom