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 Fri, Jun 22, 2012 at 10:12 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Siva" == Siva Chandra <sivachandra@google.com> writes:
>
> Siva> +static PyObject *
> Siva> +salpy_get_last (PyObject *self, void *closure)
> Siva> +{
> Siva> + ?struct symtab_and_line *sal = NULL;
> Siva> +
> Siva> + ?SALPY_REQUIRE_VALID (self, sal);
> Siva> +
> Siva> + ?return gdb_py_long_from_ulongest (sal->end - 1);
>
> It seems that sal->end can be == 0.
> For example I think gdb.decode_line can create sals like this.
> In this case I think "- 1" will yield weird results.
> Perhaps a None return would be better?

Good point.  None "works for me".


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