This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 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: Mon, 14 Apr 2014 08:41:12 +0100
- Subject: Re: [PATCH v2 2/3] gdb/python: raise TypeError instead of abort on calling value method for label symbol object
- Authentication-results: sourceware.org; auth=none
- References: <1394026864-4691-1-git-send-email-satori at yandex-team dot ru> <1394026864-4691-2-git-send-email-satori at yandex-team dot ru>
On 05/03/14 13:41, Maxim Bublis wrote:
> ---
> gdb/ChangeLog | 6 ++++++
> gdb/python/py-symbol.c | 6 ++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 8108e50..19ec13c 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,9 @@
> +2014-03-05 Maxim Bublis <satori@yandex-team.ru>
> +
> + * gdb/python/py-symbol.c (sympy_value): Throw TypeError exception
> + instead of abort on calling value method for
> + symbol object with SYMBOL_LOC_LABEL address class.
> +
> 2014-03-05 Mike Frysinger <vapier@gentoo.org>
>
> * remote-sim.c (gdbsim_load): Add const to prog.
> diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
> index 6900d58..6303cea 100644
> --- a/gdb/python/py-symbol.c
> +++ b/gdb/python/py-symbol.c
> @@ -262,6 +262,12 @@ sympy_value (PyObject *self, PyObject *args)
> return NULL;
> }
>
> + if (SYMBOL_CLASS (symbol) == LOC_LABEL)
> + {
> + PyErr_SetString (PyExc_TypeError, "It is not possible to compute the value of a label.");
> + return NULL;
> + }
I am really curious about the sigabort you were seeing. Without it I
cannot tell if there is a deeper problem in GDB, which this patch
would be papering over. Can you provide the backtrace?
Cheers
Phil