This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC - Python Scripting] Add 'end' attribute to gdb.Symtab_and_line
- From: Doug Evans <dje at google dot com>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 11 Jun 2012 14:22:06 -0700
- Subject: Re: [RFC - Python Scripting] Add 'end' attribute to gdb.Symtab_and_line
- References: <CAGyQ6gw7JP3Mz+nabiTGcnC4oP7d9iQ3W8miHOs3NnDyFqiF0g@mail.gmail.com>
On Mon, May 21, 2012 at 1:40 AM, Siva Chandra <sivachandra@google.com> wrote:
> 2012-05-21 ?Siva Chandra Reddy ?<sivachandra@google.com>
>
> ? ? ? ?New attribute 'end' for gdb.Symtab_and_line.
> ? ? ? ?* NEWS (Python Scripting): Add entry about the new attribute.
> ? ? ? ?* python/py-symtab.c (salpy_get_end): New function which
> ? ? ? ?implements the get method for the 'end' attribute of
> ? ? ? ?gdb.Symtab_and_line.
> ? ? ? ?(sal_object_getset): Add entry for the 'end' attribute.
>
> ? ? ? ?doc/
> ? ? ? ?* gdb.texinfo (Symbol Tables In Python): Add description about
> ? ? ? ?the new 'end' attribute of gdb.Symtab_and line.
>
> ? ? ? ?testsuite/
> ? ? ? ?* gdb.python/py-symtab.exp: Add tests to test the new
> attribute
> ? ? ? ?'end' of gdb.Symtab_and_line.
> ? ? ? ?* gdb.python/py-symbol.c: Move break point comment to enable
> ? ? ? ?testing of gdb.Symtab_and_line.end.
>
> Thanks,
> Siva Chandra
Hi.
Yeah, "end" would kinda be consistent and is yet a bit too vague.
Let's go with "end_pc" and at least leave "pc" alone for now.
One question we need to answer is what behaviour to expose in the API.
Is the range [pc,end_pc] or [pc,end_pc)?
[I know what the internal code does, but we don't have to follow it if
it makes for a sufficiently better API.]
And we need to clearly document this behaviour.
I don't have a strong preference on which one to use.
[One recognizes that [pc,end_pc] doesn't have a problem at 0xff...ff,
but I'm not sure it matters in practice.]