[PATCH 1/3] Change how Python architecture and language are handled

Tom Tromey tromey@adacore.com
Mon Jan 10 21:15:59 GMT 2022


>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

>> -  gdbpy_enter enter_py (garch, current_language);
>> +  gdbpy_enter enter_py (b->gdbarch ? b->gdbarch : nullptr);

Andrew> This pattern is repeated through out this patch, and feels really
Andrew> odd.
Andrew> Isn't this code equivalent to:
Andrew>   gdbpy_enter enter_py (b->gdbarch);

Yeah, I don't know why I didn't realize that.
I'll simplify this.

>> -  gdbpy_enter (struct gdbarch *gdbarch, const struct language_defn *language);
>> +  explicit gdbpy_enter (struct gdbarch *gdbarch = nullptr,
>> +			const struct language_defn *language = nullptr);

Andrew> I know the old code was not commented, but it would be awesome if we
Andrew> could take this opportunity to add a description of what the function
Andrew> does, and what the parameters are used for.

Will do.

Tom


More information about the Gdb-patches mailing list