This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC - Python Scripting] Add 'end' attribute to gdb.Symtab_and_line


On Tue, Jun 12, 2012 at 2:52 AM, Doug Evans <dje@google.com> wrote:
> Let's go with "end_pc" and at least leave "pc" alone for now.

Done.

> 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.]

I have changed the behavior to [pc, end_pc] as this (at least the
name) feels more meaningful to me. But, why was right open behavior
chosen for internal code? Even the two-argument flavor of the
'disassemble' command has right open behavior.

> And we need to clearly document this behaviour.

I have described it in the documentation as "the end address of the
program counter address range for the current source line".

2012-06-12  Siva Chandra Reddy  <sivachandra@google.com>

        New attribute 'end_pc' for gdb.Symtab_and_line.
        * NEWS (Python Scripting): Add entry about the new attribute.
        * python/py-symtab.c (salpy_get_end_pc): New function which
        implements the get method for the 'end_pc' attribute of
        gdb.Symtab_and_line.
        (sal_object_getset): Add entry for the 'end_pc' attribute.

        doc/
        * gdb.texinfo (Symbol Tables In Python): Add description about
        the new 'end_pc' attribute of gdb.Symtab_and line.

        testsuite/
        * gdb.python/py-symtab.exp: Add tests to test the new attribute
        'end_pc' of gdb.Symtab_and_line.
        * gdb.python/py-symbol.c: Move break point comment to enable
        testing of gdb.Symtab_and_line.end_pc.

Thanks,
Siva Chandra

Attachment: sal_end_patch_v2.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]