Re: [RFC 2/9] gdb/python: preserve identity for gdb.Symbol objects

Tom Tromey
2025-02-20T19:23:02Z

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

Jan> This commit changes symbol_to_symbol_object() so that each it is called
Jan> with a particular struct symbol * it returns the very same gdb.Symbol
Jan> object.

Jan> + /* Can it really happen that symbol->symtab () is NULL? */

FWIW this is a classic sort of question in gdb and perhaps no one knows
the answer.

Jan> + return (PyObject*)sym_obj;

Spaces.

Jan> + else
Jan> + {
Jan> + sympy_gdbarch_data_key.set (sym_obj->symbol->arch (),
Jan> + sym_obj->next);
Jan> + }

Over-bracing.

Tom