This is the mail archive of the 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 <> wrote:
> 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.]

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

        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
        (sal_object_getset): Add entry for the 'end_pc' attribute.

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

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

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]