This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [python][patch] Fix 11036
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 25 Feb 2010 11:33:49 -0700
- Subject: Re: [python][patch] Fix 11036
- References: <20100225142823.GA10175@localhost.localdomain>
- Reply-to: tromey at redhat dot com
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> 2010-02-25 Phil Muldoon <pmuldoon@redhat.com>
Phil> PR python/11036
Phil> * python/py-frame.c (frapy_read_var): Add block argument and logic
Phil> to cope with user provided blocks.
Phil> + argument must be an instance of gdb.Block. Returns None if GDB
Phil> + can't find the specified variable. */
This last sentence in this comment seems to be wrong.
Sometimes the function returns None, sometimes it throws an exception.
I think the function should behave more predictably somehow.
Phil> + block = block_object_to_block (block_obj);
Phil> + if (block == NULL)
Phil> + return NULL;
When block_object_to_block returns NULL, it does not set the Python
exception. That makes this code erroneous.
In other respects the code bits seem reasonable to me.
Tom