This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] gdb/python: raise TypeError instead of abort() on calling .value() method for label symbol object
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Maxim Bublis <satori at yandex-team dot ru>, gdb-patches at sourceware dot org
- Date: Tue, 04 Mar 2014 17:57:21 +0000
- Subject: Re: [PATCH 2/3] gdb/python: raise TypeError instead of abort() on calling .value() method for label symbol object
- Authentication-results: sourceware.org; auth=none
- References: <1393929360-31299-1-git-send-email-satori at yandex-team dot ru> <1393929360-31299-3-git-send-email-satori at yandex-team dot ru>
On 04/03/14 10:35, Maxim Bublis wrote:
>
> + if (SYMBOL_CLASS (symbol) == LOC_LABEL)
> + {
> + PyErr_SetString (PyExc_TypeError, "cannot get the value of a label");
Error text should be complete sentences with punctuation and proper
capitalization (I know there are a few in the code base that aren't,
but we'll get them all eventually).
> + return NULL;
> + }
> +
> TRY_CATCH (except, RETURN_MASK_ALL)
> {
> if (frame_obj != NULL)
This patch looks fine to me apart from one further small aside (please
wait for a maintainer to approve your patch, regardless). In the
documentation you note there are other types of symbol that can
produce this error: e.g., SYMBOL_LOC_TYPEDEF. Can you please audit and
include checks for all, while you are there? I noticed only the
explicit LOC_LABEL check in the patch above.
Cheers,
Phil