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: Maxim Bublis <satori at yandex-team dot ru>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 17 Apr 2014 16:44:30 +0400
- 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
- Authentication-results: smtpcorp4.mail.yandex.net; dkim=pass header dot i= at yandex-team dot ru
- 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> <534B9118 dot 9010307 at redhat dot com> <8DDE7431-40A7-4C4F-9681-E60A712710A1 at yandex-team dot ru>
Hi, Phil.
> So, it doesn’t look like some deeper problem in GDB for me, just incompleteness of Python API.
> There is very similar “if” condition for LOC_TYPEDEF in patched code.
I’ve inspected code some more. It seems to me there is a bug in gdb/findvar.c:466.
According to gdb/mdebugread.c:694, it is pretty clear that label symbol always has type of builtin integer:
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int;
but store_typed_address expects TYPE_CODE_PTR or TYPE_CODE_REF, so instead of
store_typed_address there should be something like store_unsigned_integer.
Am I correct with my guess?