This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][python] Fix some unguarded GDB calls.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]