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: [patch][python] Add breakpoint support.


>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

Joel> This is definitely the standard, currently. Is that normal?

Phil> In the archer repository some are and some aren't (for whatever
Phil> reason).

Yeah, we probably just missed them.

Joel> Personally (and I litterally mean it, it's a personal preference),
Joel> I'd rather we did not use macros, but a real function... Being a static
Joel> function, I'm sure the compiler will be capable of performing whatever
Joel> is best for performance (and that way, we can avoid the parens around
Joel> "Num", and the "do/while(0)" dance in the macro that follows).

Phil> The use of macros to check consistency of various GDB objects in the
Phil> Python API seems pretty consistent with the code that is already in
Phil> FSF CVS, and the code that is still in the Archer GIT repository .  As
Phil> a lot of this code is an effort from several different people over
Phil> several periods of time, I cannot answer why this trend became the
Phil> default.

Things like GDB_PY_HANDLE_EXCEPTION have a "return" built in, which is
why they must be macros.

In this code I think it would be ok to replace BPPY_VALID_P with an
appropriately-named static function.  However, BPPY_REQUIRE_VALID and
BPPY_SET_REQUIRE_VALID still have to be macros.  (Well... you could make
them functions and do an extra check in the caller, but as you say this
style is already prevalent in the python code.)

Tom


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