This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Debug Methods in GDB Python
- From: Doug Evans <dje at google dot com>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 9 Jan 2014 11:01:26 -0800
- Subject: Re: [PATCH] Debug Methods in GDB Python
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gxURLZn0bVH0ztDsyqNyNCNsEx-QkJa6OLd0o8u4Vv_Yg at mail dot gmail dot com> <CAGyQ6gxe2UiMFJs6LDBxetc9ZDuhHj5uc0HP0Pd=ebqNdJ-_Mg at mail dot gmail dot com> <m3wqjize2h dot fsf at sspiff dot org> <CAGyQ6gyoZdRdXr9PY-ZaO=X1z7v8uj2i_PSzLi-ZMnr=J0LvJQ at mail dot gmail dot com> <CAP9bCMTDjJ_ZEqhSbZAwGu8CswZJsLu7UrSL5JeY72bb9AO-qQ at mail dot gmail dot com> <CAGyQ6gycVe2-32djRDfYBWjGQ2LLwqzzR1q0iFBoW+zG5vttvg at mail dot gmail dot com> <CAP9bCMT0M9ZM+hiF9A0jKb125F+9a9b84+hp9mNkj7ek-a0T-w at mail dot gmail dot com> <CAGyQ6gxGO+d2aV3fs8OUc_JkjR1Uw4kF0goeOzayifniYhE+yg at mail dot gmail dot com> <CADPb22SWdHHC7XUFrnu+sSbe8TTGuMqsZKt81yaN_kA2Xa_ysg at mail dot gmail dot com> <CAGyQ6gyrrLSMaYaxWriMUTYFfKZ9VAP95jL=ShP_3Fag=REPtg at mail dot gmail dot com>
On Tue, Jan 7, 2014 at 4:48 PM, Siva Chandra <sivachandra@google.com> wrote:
> I am assuming you have not prescribed anything here, but are only
> presenting pros of doing things in a certain way. I am also assuming
> that you are waiting for others to chime in with their views.
For the most part, correct.
Though I haven't seen a compelling argument to be different than how
pretty-printers do things.
> On Fri, Jan 3, 2014 at 10:52 AM, Doug Evans <dje@google.com> wrote:
>> I like having the object gdb calls to do the lookup return another
>> object that gdb calls to implement the functionality.
>>
>> 1) It supports more flexibility in how the user can organize things
>> (e.g., one "lookup" object can handle different "worker" objects).
>
> For doing such things, I had a design like this in mind: We setup up a
> hierarchy of DebugMethod classes. The base class only does type and
> method matching. The derived concrete classes extend the base class by
> adding arg matching and the method invocation. This way, 'lookup' and
> 'worker' functionalities are separated code wise but still
> encapsulated in a single DebugMethod object.
>
>> 2) The worker object can obtain state at runtime (it is constructed at
>> lookup time).
>
> This can be done on a single object by providing a setter?
But if this single object isn't constructed at lookup time this would
be modifying, essentially, global state.
[Maybe I'm misunderstanding.]