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: Siva Chandra <sivachandra at google dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 7 Jan 2014 16:48:59 -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>
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.
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?