Re: [PATCH v2] gdb/python: add property ranges to gdb.Block object

Tom Tromey
2026-03-12T15:16:23Z

>>>>> "Jan" == Jan Vrany <jan.vrany@labware.com> writes:

Jan> + return Py_BuildValue ("((KK))", block->start (), block->end ());

Jan> + gdbpy_ref<> range_obj (Py_BuildValue ("(KK)", ranges[i].start (),
Jan> + ranges[i].end ()));

I'm sorry I didn't think of this in the last review, but when using
varargs it is up to the caller to ensure that the types are correct.

Also, we apparently still support versions of Python that don't
guarantee "long long" support. There's some text in python-internal.h
about this, look for "HAVE_LONG_LONG".

So I think this code needs to use GDB_PY_LLU_ARG and have explicit casts
to gdb_py_ulongest.

Or maybe be written in some other way.

Tom