This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Frames as scopes
- From: Doug Evans <dje at google dot com>
- To: Jim Blandy <jimb at red-bean dot com>
- Cc: archer at sourceware dot org
- Date: Thu, 1 Jan 2009 09:47:42 -0700
- Subject: Re: Frames as scopes
- References: <8f2776cb0812301357m6aebb269t2c228e378c58a37c@mail.gmail.com>
On Tue, Dec 30, 2008 at 2:57 PM, Jim Blandy <jimb@red-bean.com> wrote:
> I've been having a great time playing with the Python interface!
>
> On IRC, Tom invited me to post suggestions.
>
> Is there a way to look up a variable in the scope specified by a frame? Saying
>
> gdb.lookup_symbol('argc',gdb.block_for_pc(gdb.current_frame().pc()),gdb.SYMBOL_VAR_DOMAIN)
>
> seems circuitous; perhaps lookup_symbol could default the domain to
> SYMBOL_VAR_DOMAIN, and accept a frame to indicate scope, defaulting to
> the current frame. Then one could simply say:
>
> gdb.lookup_symbol('argc')
>
> and get what one expects.
>
Another way to go is to have wrappers that simplify common operations
as part of some utility library (or some such). Low level api
routines shouldn't be too clever.